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

Explain database link?

666


What is the data pump export utility?

645


Please explain joins in oracle?

549


Explain what are the different type of segments?

580


What is tns service name?

624






Why packages are used in oracle?

542


What is Java Pool in Oracle?

604


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

578


You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?

1448


What is not equal to in oracle?

528


What are privileges and grants?

572


what is meant by magic query

1775


Explain oracle’s system global area (sga).

626


What is an external table?

588


What is a nested table and how is it different from a normal table?

582