how to find nth highest salary
Answer Posted / nitin munjani
Using Row_Number() function
Here N refers the Nth highest salary
select empid,empname from mstemployee where empsalary in (
(select empsalary from
(select Row_Number() over(order by empsalary desc)
rownm,empsalary from mstemployee
group by empsalary) o where rownm=N))
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what are the new features in SSRS?
How to rename an existing column with the "sp_rename" stored procedure in ms sql server?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
What are truncate options available in sql server? : sql server database administration
Do you know what is xpath?
How can I change procedure name in sql server?
How to set a database state to offline in ms sql server?
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
Why do we use stored procedures in sql server?
What is a View ? Can we insert, Update and delete a view?
How to find which stored procedure is currently running in sql server?
What is the server name for sql management studio?
How can you set the threshold at which sql server will generate keysets asynchronously?
What is data source object?
What are the 10 characteristics of data quality?