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
Difference between pre-select and pre-query
State the difference between a primary key and foreign key?
How to shutdown your 10g xe server?
how to join query for one source type is oracle another source type is sql server ?
What is a dynamic performance view in oracle?
What are internal user account in oracle?
Describe the types of sub query?
How to use "while" statements in oracle?
What is the usage of analyze command in oracle?
while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511
Why is oracle database so popular?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
What is the use of oracle?
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
what are steps for interface? where is exchange rate defined in which table?