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
How to recover a dropped table in oracle?
Is there a combination of "like" and "in" in sql?
Hi Can any one tell me what are the API's used in requisition import.
What the is the diff between local index and global index. give some example.
What are transaction isolation levels supported by oracle?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
What is difference between sid and service name in oracle?
How to view the tablespaces in the current database?
What is a data lock in oracle?
Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?
What is logical backup in oracle?
What do you know about normalization? Explain in detail?
What privilege is needed for a user to query tables in another schema?
Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.
Explain the truncate in oracle?