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
Do you know exporting and importing utility?
What is a db view?
What is 3nf normalization form?
Can you import Microsoft Excel data to SSRS?
Do I need a report server to run reports in my application?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
What is cross join in sql server joins?
What are the properties of the relational tables?
How many types of triggers in sql server?
How to create view in stored procedure sql server?
What are the restrictions while creating batches in sql server?
How to check table values in sql server?
role of sql sever 2005 in database rather than any other database
How to execute stored procedure in select statement sql server?
What is encryption key?