Du kan använda en underfråga för att ta bort dubbletter:
select department_id, count(*),
listagg(manager_id, ' | ') within group (order by manager_id)
from (select distinct department_id, manager_id
from employees
) e
group by department_id