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 to upsert (update or insert into a table)?

997


What do you understand by a database object?

1055


how may join possible between (requisition with purchase order)

2241


Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.

2310


What do you mean by a tablespace?

1037


What are the arithmetic operations?

1082


What is an oracle?

1010


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

2267


You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

1927


Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

2121


How to rename an index?

1069


What is ASM (Automatic Storage Management) in Oracle?

1192


Explain joins in oracle?

1033


What is the difference between a primary key & a unique key?

1088


How to retrieve data from an explicit cursor?

1057