HRMS跑组织架构(父子关系)

select  child_org.organization_id,
       child_org.name
  
from  ( select  org.name,
               org.organization_id,
               pose_child.organization_id_parent,
               pose_child.organization_id_child
          
from  hr_all_organization_units  org,
               per_org_structure_elements pose_child,
               per_org_structure_versions posv
         
where  org.business_group_id  =   202
           
and  pose_child.organization_id_child  =  org.organization_id
           
and  trunc(sysdate)  between  trunc(posv.date_from)  and
               trunc(nvl(posv.date_to, sysdate))
           
and  posv.organization_structure_id  =   940
           
and  posv.org_structure_version_id  =
               pose_child.org_structure_version_id) child_org
 start 
with  child_org.organization_id_parent  =   204
connect 
by  child_org.organization_id_parent  =  prior
           child_org.organization_id_child


你可能感兴趣的:(架构)