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

Answer Posted / pradeep nambiar

select distinct(a.salary) from employee a where &n=(select
count(distinct(b.salary)) from employee b where
a.salary=b.salary)

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is the latest version of sql server and when it is released?

541


what is the primary use of the model database? : Sql server administration

502


What are the advantages of the mirroring?

564


your distribution database is full what will u do

1676


Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

862






Write the queries for commands like Create Table, Delete table, Drop Table etc.

604


how to use DTS package in 2000,2005,2008 in sql server

1451


How to create a view using data from another view?

561


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

555


Why use triggers?

567


How to check status of stored procedure in sql server?

443


What is a transact-sql statement?

535


Can we use having clause without group by?

554


What is the purpose of the model database?

595


How to add the custom code in Report?

99