|
Posted by Ed Murphy on 09/08/06 08:56
broken arrow wrote:
> Ed Murphy wrote:
>> broken arrow wrote:
>>
>>> i have a table emp with employee id,name and mgrid
>>>
>>> I need to display the managers and the employee working under that
>>> manager . How should this be done.
>> Assuming you want the names of both, but don't care about IDs:
>>
>> select m.name, e.name
>> from emp m
>> join emp e on e.mgrid = m.employee_id
>> order by m.name
> But i need to display both id's and names then wht should i do
(Please don't top-post. Fixed.)
select m.employee_id, m.name, e.employee_id, e.name
from emp m
join emp e on e.mgrid = m.employee_id
order by m.name
Navigation:
[Reply to this message]
|