SELECT B.OPRID ,A.CAL_RUN_ID ,A.DESCR FROM PS_GP_CAL_RUN A ,PS_GP_OPR_RULE_PRF B WHERE (A.RUN_FINALIZED_IND = 'Y' AND A.PMT_SENT_IND = 'Y' ) AND (B.USED_BY = 'A' OR A.COUNTRY = B.COUNTRY) AND (EXISTS ( SELECT 'X' FROM PS_GP_CAL_RUN_DTL DTL WHERE A.CAL_RUN_ID = DTL.CAL_RUN_ID AND DTL.CALC_TYPE = 'P') OR EXISTS ( SELECT 'X' FROM PS_GP_CAL_RUN_OFF DT2 WHERE A.CAL_RUN_ID = DT2.CAL_RUN_ID )) AND EXISTS ( SELECT 1 FROM PS_GP_PSLP_SORT S WHERE S.GP_CNTRY_PSLP_SORT=A.COUNTRY) AND EXISTS ( SELECT 1 FROM PS_GP_PSLP_ASGN_ST S WHERE S.GP_CNTRY_PSLP_ASET=A.COUNTRY)
|