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

Answer Posted / karthik

select * from (select ename,eno,dept,sal,row_number() over
(partition by dept order by sal desc)top5 from emp) where
top5 <= 5

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I escape a reserved word in oracle?

630


Explain integrity constraints?

665


How to connect to the server with user account: sys?

565


How do we display rows from the table without duplicates?

550


Explain the difference between sap and oracle?

575






What is a sub query? What are its various types?

583


What is the max number of columns in an oracle table?

513


can u send the sql dumps to sivakumarr1987@gmail.com plz help me

2596


Can we commit inside a function in oracle?

558


How to unlock the sample user account in oracle?

558


When do you get a .pll extension in oracle? Explain its importance

574


what is the difference between substr and instr function in oracle?

584


How to loop through data rows in the implicit cursor?

541


Point out the difference between user tables and data dictionary?

544


How to save query output to a local file?

563