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
What is the simplest tool to run commands on oracle servers?
Explain the use of file option in exp command.
What is Java Pool in Oracle?
List the various oracle database objects?
what is the need of indexing topic in oracle? where do we use in a Java project? any other option other than using this to get the same result where we use indexing ?
What is an index associated with a constraint?
How many types of segments in Oracle?
Which is faster join or subquery in oracle?
What is the difference between PFILE and SPFILE in Oracle?
What is recovery manager(rman) backup in Oracle?
How to apply filtering criteria at group level in oracle?
Differentiate between translate and replace?
What is the difference between a primary key & a unique key?
How do I know if oracle is installed on windows?
How many data types are supported?