how to find nth highest salary

Answer Posted / anand patel.

It is a very generic and easy way to find the Nth higest
salary with there employee/s name.

select * from emp where salary =
(select max(salary) from emp where salary in
(select top (select (count(*)-(n-1))from emp) salary
from emp order by salary))

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between a having clause and a where clause.

522


Explain triggers in sql?

552


why would you call update statistics? : Sql server database administration

575


What is the difference between osql and query analyzer?

543


What is the maximum size of sql server database?

509






What is analysis service repository?

585


What is entity data services?

577


Can we use max in where clause?

512


Does a server store data?

500


what is package and it uses and how can u call a package

1559


What are cursors in ms sql server?

595


How many columns can we include on clustered index ?

511


What do you need to connect php to sql server?

537


Can an automatic recovery be initiated by a user?

559


What are the properties of the transactions?

614