Organizational Hierarchy Query

Query for getting Organizational Hierarchy
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 = 61
–and org.name like ‘201.Financiale Services’
start with
pose.organization_id_parent = 89 — Orgnization of parent id — provide the id from which level the downward hierarchy should be displaed
CONNECT BY PRIOR
pose.organization_id_child = pose.organization_id_parent
ORDER SIBLINGS BY
org.location_id,
pose.organization_id_child;

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s