SELECT HDR.CONTRACT_NUM , SUM(BUD.FOREIGN_AMOUNT) FROM PS_CA_CONTR_HDR HDR , PS_PC_BUD_DETAIL BUD , PS_CA_DETAIL_PROJ DTL , PS_PC_BUD_PLAN PLN , PS_GM_AWARD AWD WHERE DTL.CONTRACT_NUM = HDR.CONTRACT_NUM AND HDR.CONTRACT_NUM= AWD.CONTRACT_NUM AND DTL.BUSINESS_UNIT_PC = BUD.BUSINESS_UNIT AND DTL.PROJECT_ID = BUD.PROJECT_ID AND DTL.ACTIVITY_ID = BUD.ACTIVITY_ID AND HDR.CA_PROC_STATUS ='A' AND BUD.BUSINESS_UNIT =PLN.BUSINESS_UNIT AND BUD.PROJECT_ID =PLN.PROJECT_ID AND BUD.PC_BUDGET_ID =PLN.PC_BUDGET_ID AND PLN.PC_BUD_TYPE = 'C' AND BUD.GM_CS_SEQ_FLG <>'2' GROUP BY HDR.CONTRACT_NUM
|