SELECT a.organization_id
INV_ORG,
a.organization_code,
a.organization_name,
a.operating_unit,
b.name OU,
a.set_of_books_id,
d.name LEDGER,
a.legal_entity,
c.name LE_NAME,
d.currency_code,
e.segment1
FROM apps.ORG_ORGANIZATION_DEFINITIONS
a,
apps.HR_OPERATING_UNITS
b,
apps.xle_entity_profiles
c,
apps.gl_ledgers d,
apps.GL_CODE_COMBINATIONS_KFV
e
WHERE 1 = 1
AND d.RET_EARN_CODE_COMBINATION_ID
= e.CODE_COMBINATION_ID
AND a.operating_unit
= b.organization_id
AND c.legal_entity_id
= a.legal_entity
AND d.ledger_id = a.set_of_books_id