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

What are the purposes of floor and sign functions?

633


Explain primary key?

625


What is model database in sql server?

682


What is stored in the mssqlsystemresource database? : sql server database administration

675


What is stretch database in sql server?

655






Define synonym?

804


How to modify an existing stored procedure in ms sql server?

632


How do I debug a stored procedure in sql server?

622


What is normalization of database? What are its benefits?

589


Tell about MOM Tool(Microsoft Operator Manager)?

1500


What is forward - only cursors / read only cursor?

626


What is co-related sub query?

643


What is explicit cursors?

638


What are the features of Embedded SQL

776


how can you attach more than 20 ldf files in sql server

1648