SELECT BD.BUSINESS_UNIT ,BD.PROJECT_ID ,PRJ.DESCR ,PRJ.START_DT ,PRJ.END_DT ,BD.PC_BUDGET_ID ,BD.BUDGET_PERIOD ,CAL.BEGIN_DT ,CAL.END_DT ,BD.PC_BUDGET_ITEM ,BD.RESOURCE_AMOUNT ,MYP.OPRID FROM PS_PROJECT PRJ ,PS_PC_BUD_DETAIL BD ,PS_CAL_BP_TBL CAL ,PS_PROJ_AN_GRP_MAP AGM ,PS_SET_CNTRL_REC SCR ,PS_PC_OPRID_PRJACT MYP WHERE PRJ.BUSINESS_UNIT = BD.BUSINESS_UNIT AND PRJ.PROJECT_ID = BD.PROJECT_ID AND BD.BUDGET_PERIOD = CAL.BUDGET_PERIOD AND SCR.SETCNTRLVALUE = BD.BUSINESS_UNIT AND SCR.RECNAME = 'PROJ_AN_GRP_MAP' AND SCR.SETID = AGM.SETID AND AGM.ANALYSIS_GROUP = PRJ.AN_GRP_ACTV_BUD AND BD.ANALYSIS_TYPE = AGM.ANALYSIS_TYPE AND PRJ.BUSINESS_UNIT = MYP.BUSINESS_UNIT AND PRJ.PROJECT_ID = MYP.PROJECT_ID AND BD.KK_DISTRIB_STATUS = 'D' AND NOT EXISTS ( SELECT 'X' FROM PS_PROJ_RESOURCE PR WHERE PR.BUSINESS_UNIT = BD.BUSINESS_UNIT AND PR.PROJECT_ID = BD.PROJECT_ID AND PR.ACTIVITY_ID = BD.ACTIVITY_ID AND PR.RESOURCE_ID = BD.RESOURCE_ID ) UNION SELECT BD.BUSINESS_UNIT ,BD.PROJECT_ID ,PRJ.DESCR ,PRJ.START_DT ,PRJ.END_DT ,BD.PC_BUDGET_ID ,BD.BUDGET_PERIOD ,GM.BEGIN_DT ,GM.END_DT ,BD.PC_BUDGET_ITEM ,BD.RESOURCE_AMOUNT ,MYP.OPRID FROM PS_PC_BUD_DETAIL BD ,PS_PROJECT PRJ ,PS_GM_bud_PERIOD GM ,PS_PROJ_AN_GRP_MAP AGM ,PS_SET_CNTRL_REC SCR ,PS_PC_OPRID_PRJACT MYP WHERE PRJ.BUSINESS_UNIT = BD.BUSINESS_UNIT AND PRJ.PROJECT_ID = BD.PROJECT_ID AND BD.BUSINESS_UNIT = GM.BUSINESS_UNIT AND BD.PROJECT_ID = GM.SUB_PROP_NBR AND BD.BUDGET_PERIOD = TO_CHAR(GM.BUDGET_PERIOD_GM) AND BD.ACTIVITY_ID = GM.BUDGET_ID AND SCR.SETCNTRLVALUE = BD.BUSINESS_UNIT AND SCR.RECNAME = 'PROJ_AN_GRP_MAP' AND SCR.SETID = AGM.SETID AND AGM.ANALYSIS_GROUP = PRJ.AN_GRP_ACTV_BUD AND BD.ANALYSIS_TYPE = AGM.ANALYSIS_TYPE AND PRJ.BUSINESS_UNIT = MYP.BUSINESS_UNIT AND PRJ.PROJECT_ID = MYP.PROJECT_ID AND BD.KK_DISTRIB_STATUS = 'D' AND NOT EXISTS ( SELECT 'X' FROM PS_PROJ_RESOURCE PR WHERE PR.BUSINESS_UNIT = BD.BUSINESS_UNIT AND PR.PROJECT_ID = BD.PROJECT_ID AND PR.ACTIVITY_ID = BD.ACTIVITY_ID AND PR.RESOURCE_ID = BD.RESOURCE_ID )
|