How to select nth record from a table?

Answer Posted / soorai ganesh

SELECT * FROM
(
SELECT ROW_NUMBER() OVER(ORDER BY column_name) AS Rno,*
FROM Table_Name
)T
WHERE T.Rno = 7 -- If N is 7 other wise put ur nth value.

Is This Answer Correct ?    45 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are a scheduled jobs?

527


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

521


What is the difference between nvl and nvl2?

540


What is the use of keyword with encryption. Create a store procedure with encryption?

571


What is merge join?

563






How to create a simple table to test triggers in ms sql server?

499


Tell me what is sql profiler?

611


What is row_number()?

568


How to optimize stored procedure optimization?

510


What is the template in sql?

532


What is difference between equi join and natural join?

530


How to create a ddl trigger using "create trigger" statements?

603


How can you find out how many rows returned in a cursor?

543


What is row_number () and partition by in sql server?

514


List the different types of joins?

560