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

Answer Posted / shareef

select * from(select emp.*,
dense_rank() over(partition by deptno order by sal desc) r
from emp) where r<=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 to turn on or off recycle bin for the instance?

611


How to connect ms access to oracle servers?

552


When do we use group by clause in a sql query?

570


What is a directory object?

591


How to check database size in Oracle?

640






How to export data with a field delimiter?

582


What is Reduced List of Values?

1706


How do we get field detail of a table?

627


How to create a table index?

568


Whats the benefit of dbms_stats over analyze?

1497


How to create a stored program unit?

581


How to increment dates by 1 in oracle?

562


How to insert a new row into a table in oracle?

591


How can I see all tables in oracle?

542


What do database buffers contain?

565