I've looked at several different answers on this site and others, but I'm not having much luck figuring out how to count siblings in a hierarchical query.
I'm using Oracle 10g.
SELECT LEVEL, last_name||', '||first_name AS Manager, count(employee_id)
FROM employees
START WITH manager_id IS NULL
CONNECT BY PRIOR employee_id = manager_id
GROUP BY level
This returns 4 levels, and about 80 employees. I'm wanting to add up the number of siblings under the level 2 instead of listing them all. But, I'm getting stuck trying to figure it out.
Any nudges towards the right way? Thanks!