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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to define a variable to match a table column data type?

580


Design database draw er diagram for a certain scenario ?

4105


How to test null values?

678


How can Oracle users be audited?

610


How to create a table index in oracle?

662






What is meant by a deadlock situation?

577


WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?

1705


How do I know if oracle client is installed on windows?

498


How do I spool to a csv formatted file using sqlplus?

549


Assuming that you are an End User How to find that in the payment Batch some of the Invoice was  Missing To pay How to find That??

1274


What suggestions do you have to reduce the network traffic?

549


How to check the server version in oracle?

613


How to find the duplicate rows count from employees table in oracle?

554


Can we create trigger on materialized view in oracle?

565


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.

1612