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

Answer Posted / akhil saxena

select e1.sal from emp e1 where
n-1 = (select count(distinct(e2.sal)) from emp e2
where e2.sal<e1.sal)

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You want to implement the one-to-one relationship while designing tables. How would you do it?

539


what is the system function to get current user's user id? : Sql server database administration

565


How to test subquery results with the exists operator?

571


how many no of arguments can be passed in procedures and functions

4793


what is a schema in sql server 2005? : Sql server database administration

523






How to deploy the Report?

95


What is sqlservr.exe - process - sql server (sqlex?press)?

610


Do you think BCNF is better than 2NF & 3NF? Why?

803


What is msdb database? : SQL Server Architecture

547


What are the different SQL Server Versions you have worked on?

565


When would you use an insert into .. Select option versus an insert into .. Values option? Give an example of each?

660


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

579


What the different components in replication and what is their use?

522


How many types of subqueries are there in sql server?

471


Explain cdc and sql injection?

557