Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Where is the export dump file located?

1100


What is program global area (pga) in oracle?

982


what are actual and formal parameters?

1063


How can we delete duplicate rows in a table?

944


What is a server parameter file in oracle?

1021


How to rename an existing table?

1068


How to sort the query output in oracle?

980


Explain a data segment?

1032


How do I start tns listener?

999


How to connect ms access to oracle servers?

956


What is transport network substrate (tns) in oracle?

1003


Explain a synonym?

987


How many types of cluster table in Oracle?

1006


What is the difference between truncate & delete command?

1146


How to connect asp pages to oracle servers?

1025