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 alias?
How to use null as conditions in oracle?
How do you find out from the RMAN catalog if a particular archive log has been backed-up?
Use of an integrity constraint is better to validate data. Explain
Does oracle partitioning improve performance?
How to bring a tablespace offline?
How to connect to a remote server?
What are transaction isolation levels supported by oracle?
Name the three major set of files on disk that compose a database in Oracle?
what is the scenario where you take the database to NoArchivelog mode?
how to make an oracle object
What is a table index in oracle?
What are the oracle differences between nvl and coalesce
What is Reduced List of Values?
How to select all columns of all rows from a table in oracle?