how to find nth highest salary

Answer Posted / rahul tripathi

The Genral answer which can work on any SQL:-

select salary from emp e1 where (n-1)=(select count(*)
from emp where salary > e1.salary )

Rahul Tripathi

rahultripathi@inkanpur.com

Is This Answer Correct ?    249 Yes 76 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a covered index?

514


How can you list all the table constraints in a database?

501


List types of tables in SQL Azure?

102


Explain the use of containers in ssis and also their types?

520


What is the purpose of self join?

493






How to find related tables in sql server?

493


What do you understand by coalesce in sql server?

493


What is scrollable cursor?

534


What does Master database contains?

624


Define tool Manage Statistics in SQL Server 2000 query ?

522


Tell me what is the stuff and how does it differ from the replace function?

534


Define a cross join?

587


How to retrieve field values using mssql_result()?

622


Explain primary key, foreign key and unique key?

533


What is entity data services?

572