How to select nth record from a table?

Answer Posted / rathika

Answer #7 should be

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

where n = nth number in the list

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 1nf 2nf and 3nf?

489


Is candidate a key?

531


List down some advantages of sql stored procedure?

552


How to use transact-sql statements to access the database engine?

537


What command must you use to include the not null constraint after a table has already been created?

542






How can you ensure that the database and sql server based application perform well?

628


How to download and install the scaled-down database adventureworkslt?

606


What are the five major components of a dbms?

508


What is the difference between delete and truncate statements?

564


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1298


How do I create an extended event in sql server?

483


How to list all user defined functions in the current database?

512


What command do we use to rename a db, a table and a column?

497


What is the difference between Clustered and Non-Clustered Index?

592


What is policy based management (pbm)? : sql server database administration

585