You are here: Re: How to display the managers and the employees working under that Manager « MsSQL Server « IT news, forums, messages
Re: How to display the managers and the employees working under that Manager

Posted by blvandeb@yahoo.com on 09/15/06 19:41

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация