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


Please Help Members By Posting Answers For Below Questions

Define clusters?

724


List the different index configurations possible for a table?

598


What are date and time data types in ms sql server?

616


what's sql server? : Sql server database administration

579


What are the advantages of using third-party tools?

643






Where are sql server usernames and passwords stored in the sql server?

687


What is normalization and denormalization in sql server?

613


How can you insert values in multiple rows using one Insert statement?

694


how can you check the level of fragmentation on a table? : Sql server administration

623


Can foreign key be deleted?

606


What is the purpose of linked server configuration in sql server?

634


what are isolation levels? : Sql server database administration

573


Where are stored procedures in sql server?

646


What is difference between index seek vs. Index scan?

712


Why is the need for data conversion transformations?

587