2022-12-12

[Oracle]How to Query Organization

  
SELECT GL.LEDGER_ID,
       GL.CHART_OF_ACCOUNTS_ID      COA_ID,
       GL.NAME,
       GL.SHORT_NAME,
       GL.PERIOD_SET_NAME,
       GL.CURRENCY_CODE,
       HOU.DEFAULT_LEGAL_CONTEXT_ID LEGAL_ID,
       HOU.ORGANIZATION_ID          OU_ID,
       HOU.NAME                     OU_NAME,
       OOD.ORGANIZATION_ID          ORG_ID,
       OOD.ORGANIZATION_CODE        ORG_CODE,
       OOD.ORGANIZATION_NAME        ORG_NAME
  FROM HR_OPERATING_UNITS           HOU,
       ORG_ORGANIZATION_DEFINITIONS OOD,
       GL_LEDGERS                   GL
 WHERE HOU.ORGANIZATION_ID(+) = OOD.OPERATING_UNIT
   AND OOD.SET_OF_BOOKS_ID(+) = GL.LEDGER_ID
   AND HOU.DATE_TO IS NULL
 ORDER BY GL.CHART_OF_ACCOUNTS_ID, OOD.ORGANIZATION_ID

沒有留言:

張貼留言