how will I find the first 5 highest salaried employees in
each dept in oracle.
Answer Posted / murali mohan
Try This,
select empno,deptno,sal,dense_rank from (SELECT empno,
deptno,sal,
DENSE_RANK() OVER (PARTITION BY
deptno ORDER BY sal DESC NULLS
LAST) DENSE_RANK
FROM emp) tmp
where dense_rank<=5;
Regards,
Murali
Is This Answer Correct ? | 21 Yes | 3 No |
Post New Answer View All Answers
Which are the five query types available in oracle?
What are privileges and grants?
What is SQL Tuning Advisor in Oracle?
How many types of auditing in Oracle?
Explain the use of indexes option in exp command.
What is the difference between formal parameters and actual parameters?
How to add a new column to an existing table with a default value?
Explain the use of record option in exp command.
How to loop through data rows in the implicit cursor?
What are the execution control statements in oracle?
A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.
How to use "while" statements in oracle?
How to open and close an explicit cursor in oracle?
How to create a single index for multiple columns?
How to export your own schema?