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

What is the difference between writing data to mirrored drives versus raid5 drives

515


Can you explain what are the restrictions applicable while creating views? : SQL Server Architecture

499


Explain what are sparse columns?

570


What is the simplest way to create a new database in ms sql server?

542


explain what is raid and what are different types of raid configurations? : Sql server database administration

552






Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?

503


You want to implement the one-to-many relationship while designing tables. How would you do it?

513


What is the largest component inside a field?

534


what are the different ways to return the rowcount of a table?

579


Explain the flow of creating a cube? : sql server analysis services, ssas

629


How do I create a stored procedure in sql server?

527


What is normalization? Describe its different types.

587


Is t sql the same as sql server?

522


Can you explain different types of joins?

549


Is sql server difficult to learn?

527