Find top Nth employee from each department in terms of
salary?

Answer Posted / rakhi

Select Salary From [TableNAme] WHERE Salary IN(Select Top
Nth Salary From [TableName] ORDER BY Salary DESC) ORDER BY
DESC

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is table value parameters (tvp)?

549


What are types of scd? : sql server analysis services, ssas

540


Any one plz send me SQL Server Developer/DBA resume for 4 years experience

2182


How to delete exactly duplicate records from a table?

607


When we should use @@error?

543






What is the use of for clause?

585


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

571


What is page-level compression?

558


What is clustered vs nonclustered index?

509


What are different types of subquery?

721


What are the different types of indexes?

613


When multiple after triggers are attached to sql table, how to control the order of execution?

535


What is a database table?

527


On a windows server 2003 active – passive failover cluster, how do you find the node which is active?

654


How you can move data or databases between servers and databases in sql server?

570