September 24th, 2012, 11:24 AM
Any idea how to count siblings in a hierarchical query? I'm trying to get a listing of employees
SELECT LEVEL, last_name||', '||first_name AS Manager, count(employee_id)
START WITH manager_id IS NULL
CONNECT BY PRIOR employee_id = manager_id
GROUP BY level
This returns 4 levels. I'm wanting to add up the number of siblings under the level 2 instead of listing them all. But, I'm getting stuck.
September 25th, 2012, 09:54 AM
You need to either remove the following fields from the select part or add the same into the group by clause after level.
last_name||', '||first_name AS Manager