419: from dual
420: union all
421: select x.sub_organization_id as organization_id
422: from per_org_hrchy_summary x,
423: per_org_structure_versions v,
424: per_org_structure_versions currv
425: where v.org_structure_version_id = p_org_structure_version_id and
426: v.organization_structure_id = currv.organization_structure_id and
427: (currv.date_to is null or
420: union all
421: select x.sub_organization_id as organization_id
422: from per_org_hrchy_summary x,
423: per_org_structure_versions v,
424: per_org_structure_versions currv
425: where v.org_structure_version_id = p_org_structure_version_id and
426: v.organization_structure_id = currv.organization_structure_id and
427: (currv.date_to is null or
428: sysdate between currv.date_from and currv.date_to) and
490: from dual
491: union all
492: select x.sub_organization_id as organization_id
493: from per_org_hrchy_summary x,
494: per_org_structure_versions v,
495: per_org_structure_versions currv
496: where v.org_structure_version_id = p_org_structure_version_id and
497: v.organization_structure_id = currv.organization_structure_id and
498: (currv.date_to is null or
491: union all
492: select x.sub_organization_id as organization_id
493: from per_org_hrchy_summary x,
494: per_org_structure_versions v,
495: per_org_structure_versions currv
496: where v.org_structure_version_id = p_org_structure_version_id and
497: v.organization_structure_id = currv.organization_structure_id and
498: (currv.date_to is null or
499: sysdate between currv.date_from and currv.date_to) and
552: from dual
553: union all
554: select x.sub_organization_id as organization_id
555: from per_org_hrchy_summary x,
556: per_org_structure_versions v,
557: per_org_structure_versions currv
558: where v.org_structure_version_id = p_org_structure_version_id and
559: v.organization_structure_id = currv.organization_structure_id and
560: (currv.date_to is null or sysdate between currv.date_from and currv.date_to) and
553: union all
554: select x.sub_organization_id as organization_id
555: from per_org_hrchy_summary x,
556: per_org_structure_versions v,
557: per_org_structure_versions currv
558: where v.org_structure_version_id = p_org_structure_version_id and
559: v.organization_structure_id = currv.organization_structure_id and
560: (currv.date_to is null or sysdate between currv.date_from and currv.date_to) and
561: x.organization_structure_id = currv.organization_structure_id and
761: FROM dual
762: UNION ALL
763: SELECT x.sub_organization_id AS organization_id
764: FROM per_org_hrchy_summary x,
765: per_org_structure_versions v,
766: per_org_structure_versions currv
767: WHERE v.org_structure_version_id = p_org_structure_version_id AND
768: v.organization_structure_id = currv.organization_structure_id AND
769: (currv.date_to IS NULL OR
762: UNION ALL
763: SELECT x.sub_organization_id AS organization_id
764: FROM per_org_hrchy_summary x,
765: per_org_structure_versions v,
766: per_org_structure_versions currv
767: WHERE v.org_structure_version_id = p_org_structure_version_id AND
768: v.organization_structure_id = currv.organization_structure_id AND
769: (currv.date_to IS NULL OR
770: sysdate BETWEEN currv.date_from AND currv.date_to) AND