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
Where is the export dump file located?
What is program global area (pga) in oracle?
what are actual and formal parameters?
How can we delete duplicate rows in a table?
What is a server parameter file in oracle?
How to rename an existing table?
How to sort the query output in oracle?
Explain a data segment?
How do I start tns listener?
How to connect ms access to oracle servers?
What is transport network substrate (tns) in oracle?
Explain a synonym?
How many types of cluster table in Oracle?
What is the difference between truncate & delete command?
How to connect asp pages to oracle servers?