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 are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?

680


While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?

713


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

591


How to use subqueries in the from clause in ms sql server?

664


on line cluster can we make if yes tell me the procedure

1613






What do you mean by subquery?

662


Define outer join in sql server joins?

597


Explain the first normal form(1nf)?

638


Is foreign key a primary key?

587


What is similarity and difference between truncate and delete in sql?

657


What is a partitioned view?

678


What is the difference between createstatement and preparedstatement?

583


Differentiate between truncate vs delete in mssql?

600


What is difference between clustered and non clustered index?

604


What is a fill factor?

719