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

How to write a query with a left outer join in oracle?

1126


How to build data dictionary view an new database?

1052


What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?

1166


What are group functions in oracle?

1097


What are the different types of partitions in oracle?

1034


What is a package in oracle?

1163


Explain an index?

1182


Give the various rollback segment states.

1090


How to increment dates by 1 in oracle?

1138


Describe the types of sub query?

1058


What is Trigger in Oracle?

1244


State the various uses of dbcc command?

1111


What are the built-in functions used for sending Parameters to forms ?

3437


does the query needs a hint to access a materialized view?

1910


In the oracle version 9.3.0.5.0, what does each number shows?

1347