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

Answer Posted / ravindra reddy

select *from(select b.* from emp b order by sal desc)where rownum<=5 order by sal desc
------------------------------------------------------------
select *from(select b.*,rank() over(order by sal desc) from emp b)where rownum<=5

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert numbers to characters in oracle?

585


HI, Please let me know the syllabus for Oracle OCA and OCP Certification

1951


How to test null values?

676


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1487


In oracle there is column command, how will you explain that?

547






How to use like conditions in oracle?

567


How to delete all rows a table in oracle?

621


What is oracle used for?

534


What is a procedure in oracle?

616


What is tns entry?

621


What is a trace file and how is it created in oracle?

552


How to recover a dropped table in oracle?

603


How to use attributes of the implicit cursor in oracle?

562


Is oracle a language?

522


What do you mean by a deadlock?

515