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 / 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


Please Help Members By Posting Answers For Below Questions

What are the various oracle database objects?

1148


How to get execution statistics reports on query statements?

1104


How to get a create statement for an existing table?

975


How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.

2182


What are group functions in oracle?

1047


What is connection pool in oracle?

992


How to create a single index for multiple columns?

1042


Can we connect to ORACLE db using Windows Authentication?

1264


In what script is snap$ created? In what script is the scott/tiger schema created?

2711


How to connect the oracle server as sysdba?

1082


What is the difference between count (*), count (expression), count (distinct expression)?

1013


How can we delete duplicate rows in a table?

979


How to write date and time interval literals in oracle?

1036


What is snapshot is too old? Give and example for better understand.

1607


How to load excel data sheet to oracle database

1030