Запрос для вывода иерархии организаций.
Список существующих иерархий можно увидеть в таблице hr.per_organization_structures.
SELECT LPAD(' ', 10 * (LEVEL - 1)) || org.name hierarchy, org.organization_id FROM hr_all_organization_units org, per_org_structure_elements pose WHERE 1 = 1 AND org.organization_id = pose.organization_id_child AND pose.org_structure_version_id = &p_structure_version_id -- START WITH org.organization_id = CONNECT BY PRIOR pose.organization_id_child = pose.organization_id_parent ORDER SIBLINGS BY org.location_id, pose.organization_id_child;
Последние комментарии