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
Explain the use of grant option in imp command.
Explain the types of exception?
Briefly explain what is literal? Give an example where it can be used?
defination of bitmap index
How to delete a column in an existing table?
How to start an oracle instance?
Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?
How many anonymous blocks can be defined?
How to export data to a csv file?
What are the advantages of oracle?
How to put more than 1000 values into an oracle in clause?
How to sort the query output in oracle?
What is the use of file param in imp command?
How to run the anonymous block again?
Explain the use of ignore option in imp command.