how will I find the first 5 highest salaried employees in
each dept in oracle.
Answer Posted / ravindra reddy
select *from(select b.* from emp b order by sal desc)where rownum<=5 order by sal desc
------------------------------------------------------------
select *from(select b.*,rank() over(order by sal desc) from emp b)where rownum<=5
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How would you begin to troubleshoot an ORA-3113 error?
What types of joins are used in writing subqueries?
Differentiate between translate and replace?
How to divide query output into groups in oracle?
What is dynamic proxy?
What is snapshot is too old? Give and example for better understand.
Explain self joins in oracle?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
What are set operators?
What is a trigger oracle?
I have a database backup file in .db (ext) form how to conver it into .dmp (ext.) for oracle database
What happens if variable names collide with table/column names?
Is insert autocommit in oracle?
How do I decide when to use right joins/left joins or inner joins or how to determine which table is on which side?
interview questions with answer for cts