how will I find the first 5 highest salaried employees in
each dept in oracle.

Answer Posted / manjusure@yahoo.co.in

select * from emp e where 5> (select count(max(sal)) from emp
where e.deptno=deptno and sal>e.sal group by sal);

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is rowid unique in oracle?

528


Can objects of the same schema reside in different tablespace?

586


21. Using a set operator, display the client number of all clients who have ever placed an order and whose whose name does not contain the string Sm.

1620


Is there a function to split a string in plsql?

568


types of indexes and the rationale behind choosing a particular index for a situation.

1984






How do I uninstall oracle 11g?

559


how to convert .db (extention) database file into .dmp (extention ) for oracle database ?

2063


How to display employee records who gets more salary than the average salary in the department?

597


How to loop through a cursor variable?

569


What are internal user account in oracle?

571


How to view the tablespaces in the current database?

559


What is the relation of a user account and a schema?

613


what is normalisation?what are its uses?

1761


What are the roles of dba?

614


What is a data dictionary and how can it be created?

615