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

Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?

2038


if you ctreate table identity

2430


What is pragma autonomous transaction in oracle?

1128


Explain about functional dependency and its relation with table design?

1061


What are the ways tablespaces can be managed and how do they differ?

2452


How to add a new column to an existing table with a default value?

1061


What is hot backup and logical backup?

1115


How to filter out duplications in the returning rows using oracle?

1068


What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.

1032


What is the difference between pre-select and pre-query?

1305


What happens in oracle commit?

1082


What is archive log in Oracle?

1185


How to export data with a field delimiter?

1089


What happens to the current transaction if the session is killed?

1043


How can Oracle users be audited?

1172