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 would you begin to troubleshoot an ORA-3113 error?

2046


What types of joins are used in writing subqueries?

949


Differentiate between translate and replace?

1058


How to divide query output into groups in oracle?

954


What is dynamic proxy?

975


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

1556


Explain self joins in oracle?

959


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.

2148


What are set operators?

1045


What is a trigger oracle?

1053


I have a database backup file in .db (ext) form how to conver it into .dmp (ext.) for oracle database

2099


What happens if variable names collide with table/column names?

1127


Is insert autocommit in oracle?

1036


How do I decide when to use right joins/left joins or inner joins or how to determine which table is on which side?

982


interview questions with answer for cts

2547