Tuesday, June 8, 2010

write sql query to get the employees names under manager

It has emp table and mgr table.

To query the EMP table for the direct reports to the employee KING, you could write the following:

select ename from emp e
where mgr in (select empno from emp where ename = 'KING');

No comments:

Post a Comment