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

Answer Posted / praveen marigaddi.

select distinct sal from emp a where 5 >(select count
(distinct sal) from emp where sal>a.sal) order by a.sal desc

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which environment variables are absolutely critical in order to run the OUI?

1642


What are the general rules on data consistency?

577


Explain drop constraint oracle?

589


How would you change old and new values in an insert, delete and update triggers?

537


What is MTTR advisor in Oracle?

598






How to list all user accounts in oracle?

603


Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?

924


What are the oracle built-in data types?

555


What is the difference between substr and instr?

511


How to get a list of all background sessions in the database?

530


how may join possible between (requisition with purchase order)

1695


Please explain compound trigger in oracle?

589


if you ctreate table identity

1839


What happens if you set the sga too low in oracle?

546


What is the difference between post-database commit and post-form commit?

510