how will I find the first 5 highest salaried employees in
each dept in oracle.

Answer Posted / praveen marigaddi.

select distinct sal from emp a where 5 >(select count
(distinct sal) from emp where sal>a.sal) order by a.sal desc

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to calculate date and time differences in oracle?

626


What is the order of defining local variables and sub procedures/functions?

689


Explain about achiever in sql?

665


What is a relational database management system?

756


What is the maximum number of triggers that can be applied to a single table?

651






How can I see all tables in oracle?

630


You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

1540


Explain how you would restore a database using RMAN to Point in Time?

1727


Can we store images in oracle database?

645


Why do we use bulk collect in oracle?

665


How a tablespace is related to data files?

664


What are the different types of modules in oracle forms?

639


What is merge statement used for?

659


How to do clean up if create database failed?

667


What is varray?

673