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

What is the purpose of save points in oracle database?

535


How to add a new column to an existing table in oracle?

576


For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?

1550


How to create a stored function in oracle?

579


What is a dead lock in oracle?

584






What is instant client oracle?

533


What is ordinary table in oracle?

643


What are a collation and state the different types of collation sensitivity?

545


How to save query output to a local file?

554


What is the parameter mode that can be passed to a procedure?

564


Can sub procedure/function be called recursively?

525


Difference between cartesian join and cross join?

534


What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.

641


Explain about achiever in sql?

576


How to delete an existing row from a table in oracle?

637