select mgrid, manager_name, employee_name, employee_id
from emp
group by mgrid
order by mgrid, employee_name
or if there is a manager table involved to get the manager name
select a.mgrid, b.manager_name, a.employee_name, a.employee_id
from emp as a
join manager as b
on a.mgrid = b.mgrid
group by a.mgrid
order by b.manager_name, a.employee_name
I hope this helps...
broken arrow wrote:
Hello,
I'm facing with a problem though it may look very simple for many of
u it is a bit complicated for me So kindly please help me out
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.
Thanking u
Broken Arrow