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
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?
if you ctreate table identity
What is pragma autonomous transaction in oracle?
Explain about functional dependency and its relation with table design?
What are the ways tablespaces can be managed and how do they differ?
How to add a new column to an existing table with a default value?
What is hot backup and logical backup?
How to filter out duplications in the returning rows using oracle?
What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.
What is the difference between pre-select and pre-query?
What happens in oracle commit?
What is archive log in Oracle?
How to export data with a field delimiter?
What happens to the current transaction if the session is killed?
How can Oracle users be audited?