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 do you mean by sql server 2005 express management tools?

919


Where in ms sql server is ’100’ equal to ‘0’?

708


How can delete duplicate records in cte in sql server?

611


What is difference between clustered and non clustered index?

604


How to encrypt Strored Procedure in SQL SERVER?

642






What is BCNF? How is it better than 2NF & 3NF?

682


write an SQL query to list the employees who joined in the month of January?

1261


What is difference between rownum and rowid?

591


What are the filtered indexes?

697


What is the difference between functions and stored procedures?

701


What is a mixed extent?

691


Can group functions be mixed with non-group selection fields in ms sql server?

620


How to find the version of sql server? : sql server database administration

710


What is global temp table?

671


You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?

657