how to find nth highest salary
Answer Posted / neeraj kumar
select top(1) Salary
from(select distinct top(n) Salary
from emp
order by Salary desc ) a
order by Salary
Note-you can find out any position salary through top(n).
n=1,2,3,4,5,6,7,8,9..................
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to create a large table with random data for index testing in ms sql server?
Why I have to use stored procedures?
What is attribute hierarchy? : sql server analysis services, ssas
How many non clustered indexes there can be on table ?
What is similarity and difference between truncate and delete in sql?
How to write an inner join with the where clause in ms sql server?
What is schemabinding a view?
How to list all triggers in the database with sys.triggers in ms sql server?
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
What is the difference between executequery () and executeupdate ()?
What is the command used to check locks in microsoft sql server?
What is filestream?
What happens to a trigger with multiple affected rows?
Explain ranking functions?
What is inner join? Explain with an example?