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
How would you go about verifying the network name that the local_listener is currently using?
What is the usage of control file in oracle?
Why do we need integrity constraints in a database?
Explain the use of indexes option in imp command.
What is oracle instant client?
Is insert autocommit in oracle?
What privilege is needed for a user to insert rows to tables in another schema?
How do I limit the number of rows returned by an oracle query after ordering?
What are the extensions used by oracle reports?
Explain the difference between a procedure and a function?
How to create a new user account in oracle?
What is connection pool in oracle?
How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
How many data types are supported?
What is the difference between a user and a schema in oracle?