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

select *
from employee X
where salary in (select top 5 salary
from employee
where dept = X.dept
order by salary desc)
order by dept, salary desc

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

1862


What is meant by joins? List out the types of joins.

979


What is a sub query and what are the different types of subqueries?

1088


How to define a procedure inside another procedure?

980


Explain the difference between a procedure and a function?

1108


Explain a data segment?

1032


Which environment variables are absolutely critical in order to run the OUI?

2083


How to speed up webrick?

1025


Where is the export dump file located?

1100


How to execute a stored program unit?

1023


Can we create trigger on materialized view in oracle?

950


How to turn on or off recycle bin for the instance?

1027


What privilege is needed for a user to create indexes in oracle?

982


How to create a single index for multiple columns?

992


What are the different types of synonyms?

1094