how to find the second salary?

Answer Posted / moorthy t

select n,* from(select rownum n,* from (select * from table
where group by (sal) order by (sal) desc)) where n=2;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if null values are involved in datetime operations?

541


Explain what is use of dbcc commands?

519


what is a correlated sub-query? : Sql server database administration

488


What are database states in ms sql server?

659


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

589






why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

569


How to download and install sql server 2005 books online?

551


How you can move data or databases between servers and databases in sql server?

574


How to add code to the existing article (using improve article)?

602


List out the differences between global and local temp tables in sql server?

580


What is delete query?

529


How to enable/disable indexes?

608


Does sql server use t sql?

538


How do I install only the client tools of sql server 2000?

560


How to verify the port number of the sql server?

565