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.