how to find nth highest salary
Answer Posted / latha k
declare @N INT
SET @N = 3
SELECT *
FROM [user] AS [user]
WHERE @N = (SELECT COUNT(DISTINCT(user1.Salary))
FROM [user] AS [user1]
WHERE user.Salary <= user1.Salary
)
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Define clusters?
List the different index configurations possible for a table?
What are date and time data types in ms sql server?
what's sql server? : Sql server database administration
What are the advantages of using third-party tools?
Where are sql server usernames and passwords stored in the sql server?
What is normalization and denormalization in sql server?
How can you insert values in multiple rows using one Insert statement?
how can you check the level of fragmentation on a table? : Sql server administration
Can foreign key be deleted?
What is the purpose of linked server configuration in sql server?
what are isolation levels? : Sql server database administration
Where are stored procedures in sql server?
What is difference between index seek vs. Index scan?
Why is the need for data conversion transformations?