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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create an oracle testing table?

591


Explain the use of consistent option in exp command.

552


how the indexes are stored in the Oracle Database?

1742


How is it different from a normal table?

582


What is a select query statement in oracle?

545






What is a server parameter file in oracle?

594


Give the advantages and disadvantages of clusters.

579


What is an oracle cursor variable?

611


Please explain joins in oracle?

549


What types of joins are used in writing subqueries?

569


How to use fetch statement in a loop?

553


What is dual table oracle?

527


How do we display rows from the table without duplicates?

550


Explain what are the different type of segments?

580


Does oracle partitioning improve performance?

552