SELECT E.DISPLAY_TARGET_ID, A.BUDGET_PERIOD, A.BUSINESS_UNIT,B.COURSE, C.DEMAND_ID, SUM(A.DEMAND_APPROVED)
FROM PS_TRN_SIMULATION A,PS_TRN_ALL_COURSE B, PS_TRN_DEMAND C, PS_TRN_SCENARIO D,
PS_TRN_DSPL_DEPT E
WHERE A.BUDGET_PERIOD = C.BUDGET_PERIOD
AND A.DEMAND_ID = C.DEMAND_ID
AND A.BUSINESS_UNIT = C.BUSINESS_UNIT
AND C.COURSE = B.COURSE
AND A.BUDGET_PERIOD = D.BUDGET_PERIOD
AND A.DEPTID = D.DEPTID
AND A.SCENARIO = D.SCENARIO
AND A.BUSINESS_UNIT = D.BUSINESS_UNIT
AND D.SCENARIO_STATUS = 'A'
AND A.BUSINESS_UNIT = E.BUSINESS_UNIT
AND A.DEPTID = E.DEPTID
GROUP BY E.DISPLAY_TARGET_ID, A.BUDGET_PERIOD, A.BUSINESS_UNIT,B.COURSE, C.DEMAND_ID
|