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

You have one employee table having 3 entries emp_id, Mgr_id
and salary. Mgr_id is also referencing emp_id. so now find
out the emp_id which are having the second highest salary,
under a particular manager.

Answer Posted / rajesh

select * from (select
emp_id,mgr_id,salary,dense_rank()over(partition by mgr_id order by salary desc nulls last) rn from emp) where rn=2;

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the maximum number of triggers that can be applied to a single table?

1077


What is the best way to do multi-row insert in oracle?

1114


normally database take to refresh time 2 hours. but client asked iwant to refresh with in 5 min that same database. do you have any option in BO and Oracle? explain me briefly...kavi

2264


How do you increase the OS limitation for open files (LINUX and/or Solaris)?

1983


What is rowid and rownum in oracle?

1076


How to start your 10g xe server from command line?

1134


What is the difference between alert log file and tarce file ?

2240


What is the meaning of recursive hints in oracle?

1105


How to create a single index for multiple columns?

1093


How can we force the database to use the user specified rollback segment?

1202


What is tns entry?

1247


How to import one table back from a dump file?

1092


Name the three major set of files on disk that compose a database in Oracle?

1178


How to sort the query output in oracle?

1077


How to use like conditions in oracle?

1120