You are here: Re: Select option to execute the maxi number of direct subordinate « MsSQL Server « IT news, forums, messages
Re: Select option to execute the maxi number of direct subordinate

Posted by Doug on 10/08/32 11:34

I'm rusty. I trust the peanut gallery will assist me with syntax
issues.

select employee.name, boss.name, count(employee.empid) from people as
employee
left outer join people as boss on employee.empid = boss.reportingto
where designation = 'PM'
group by employee.name, boss.name

you want the left outerjoin because sooner or later you will run into
the president of the company, who has no boss.

 

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

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