Organization query

select distinct HAOU.name,
haou.date_from “From_date”,
HV.ORG_INFORMATION1_MEANING “classification”,
HAOU.INTERNAL_EXTERNAL_FLAG “Inetrnal_external”,
(select meaning from hr_lookups where lookup_type =’ORG_TYPE’ and lookup_code= haou.type)”Type”,
(select hl.description from hr_locations hl where hl.location_id = haou.location_id) “location”
from HR_ORGANIZATION_INFORMATION HOI,
HR_ALL_ORGANIZATION_UNITS HAOU,
HR_ORG_INFORMATION_TYPES HOIT,
HR_ORGANIZATION_INFORMATION_V hv
WHERE HOI.ORGANIZATION_ID = HAOU.ORGANIZATION_ID
and HOIT.ORG_INFORMATION_TYPE = HOI.ORG_INFORMATION_CONTEXT
and HV.ORGANIZATION_ID = HAOU.ORGANIZATION_ID
and HV.ORG_INFORMATION1_MEANING is not null
ORDER BY HAOU.name;

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