Content

Board ID 1235
Writer 허진경 (나자바바)
Write Date 2023-09-01 11:28:14
Subject oracle 계층형 쿼리와 listagg 사용 예
Content select e.lv, m.first_name as manager, listagg(e.first_name, ',') within group(order by e.first_name) as member from ( select employee_id, first_name, manager_id, level as lv from employees start with manager_id is null connect by prior employee_id=manager_id ) e join employees m on e.manager_id=m.employee_id group by e.lv, m.first_name order by e.lv;