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
How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.
What are the requirements for sql server 2016?
What are system databases into sql server (2005/2008) : sql server database administration
What are the differences between web role and worker role?
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
What are sql servers used for?
What is the difference between cartesian product and cross join?
How to filter records of table in SQL SERVER?
Explain triggers?
can any body tell me how to know the password of current user in sql server
What do you do in data exploration
Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
Difference between uniqe index and uniqe constraint?
Tell me extended events in sql server 2008?
How to check table values in sql server?