how to find nth highest salary

Answer Posted / amit kumar

--- Getting 4th highest salary
--- 4 can be replaced with any number

with EmpSal as
(Select *, row_number() over (order by EmpSal Desc)
as 'rownumber' from employee)

Select * from EmpSal where rownumber =4

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to update the views? If yes, how, if not, why?

545


Can we update data in a view?

601


How to create a login account in ms sql server to access the database engine using "create login" statements?

573


Explain tables in SQL Azure?

96


Do you know the isolation level that sql server support?

528






How to compare the top two records using sql?

766


How to find Duplicate Records In table?

587


How do you rebuild an identity column?

546


How to encrypt Strored Procedure in SQL SERVER?

556


What is sqlcmd?

555


What is a virtual table in sql?

549


How to transfer data from a cursor to variables with a "fetch" statement?

582


What is use of attributehierarchyenabled? : sql server analysis services, ssas

611


How to scale out a federation by Sql statement?

92


What is snapshot replication?

599