How to select nth record from a table?

Answer Posted / andy

select a.id,a.name from dept a
where
1= (select COUNT(b.id) from dept b where b.id>a.id)

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to connect php with different port numbers?

546


What is explicit mode in sql server?

525


What is use of dbcc commands?

620


How to create nested stored procedure?

533


Explain system rowset functions?

553






What does the not null constraint do?

571


How to rebuild all indexes on a single table?

577


Explain the rules for designing files and file groups in sql server?

540


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

573


What is the optimization being performed in oracle and SQL Server?

614


How to select some specific columns from a table in a query in ms sql server?

497


Sql server reporting services vs. Crystal reports.

96


What is factless fact table? : sql server analysis services, ssas

551


Does a sql server 2005 select statement require a from?

568


Do you know what are the restrictions that views have to follow?

616