How to select nth record from a table?

Answer Posted / roxy

select top 1 * from (select top n * from tbl order by col1
desc) tbl order by col1 asc

where n = nth number in the list

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is denormalization? : Sql server database administration

480


What is the query and subquery?

626


What is a deadlock and what is a live lock?

578


Explain how to send email from sql database?

567


difference between Clustered index and non clustered index ?

581






What’s the distinction between dropping a info and taking a info offline?

598


What are indexes in sql?

580


Tell me about the approaches which you used to counter the DI problems.

768


what is a transaction? : Sql server database administration

473


Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

516


How to read data in a table with "select" statements?

564


How to provide default values to function parameters?

603


What is bcp? When does it used?

552


What is temporal data type?

525


What is the use of keyword with encryption.

583