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 |
how to handle exceptions in post production
What is Water Mark in Oracle?
How to use values from other tables in update statements using oracle?
Is the After report trigger fired if the report execution fails ?
Explain the statement?? ALTER TABLE TABLE_NAME MOVE; What it the use of above statement??
How to find out what oracle odbc drivers are installed?
How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.
List out the types of joins.
i have procedure p1.and also i declare the same procedure in a package. whice one is efficient package procedure or procedure?
What is an Oracle sequence?
What is an Extent ?
How to divide query output into groups in oracle?