how to retrive only second row from table in sql server
2000?

Answer Posted / jayaraman b

select min(emp_no) from
(select top 2 * from emp order by emp_no desc)A
--This will give you the 2nd largest Salaried employee

select max(emp_no) from
(select top 2 * from emp order by emp_no desc)A
--This will give you the 1st largest Salaried employee

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how will add additional conditions in sql?

576


What is the main difference between ‘between’ and ‘in’ condition operators?

587


Define candidate key, alternate key, and composite key.

536


What is usually the first word in a sql query?

599


How to test subquery results with the exists operator?

563






How to store and query spatial data?

562


Define self join in sql server joins?

524


How to convert a unicode strings to non-unicode strings?

563


What is a natural primary key?

524


What type of Index will get created after executing the above statement?

643


What are different replication agents and what's their purpose? : sql server replication

574


What are the export options of ssrs?

126


What are the steps to follow to configure SQL*Net?

562


Can you edit the .rdl code associated with a linked report?

109


What is stretch database in sql server?

569