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.
Answers were Sorted based on User's Feedback
Answer / kumar mrityunjay singh
SELECT *
FROM (SELECT EMPLOYEE_ID,MANAGER_ID,SALARY,DENSE_RANK() OVER(ORDER BY SALARY DESC)RN FROM EMPLOYEES WHERE MANAGER_ID='&ENTER_MANAGER_ID')WHERE RN < '&VALUE_UPTO'
/
Is This Answer Correct ? | 8 Yes | 4 No |
Answer / 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 |
Answer / chandra reddy
select empno,ename,deptno,sal from(select e.*,b.sal,rank()over(order by sal desc)send_h from em e join em1 b on e.empno=b.empno) where send_h=2
Is This Answer Correct ? | 1 Yes | 1 No |
What is the relationship among database, tablespace and data file?
what is the syntax of INSERT command?
what is difference between DBMS and RDBMS?
How to start your 10g xe server?
How to define default values for formal parameters?
What do you understand by a database object?
How to use existing values in update statements using oracle?
Name the three major set of files on disk that compose a database in Oracle?
How can you tell how much space is left on a given file system and how much space each of the file systems subdirectories take-up?
How to get execution path reports on query statements?
What is system tablespace?
how to get required data from oracle source is like this ram_05_seetha lax_05_viswa bamr05frummy run_01_away sw_sas_trim i want my target data like ram_05_seetha lax_05_viswa to get data using %_05_% but it will give ram_05_seetha lax_05_viswa bamr05frummy how can i get my target data?