SELECT DISTINCT A.RUN_CNTL_ID , A.PROCESS_INSTANCE , A.SMT_GROUP_ID FROM PS_SMT_STG_DTL A , PS_PYMNT_VCHR_XREF B , PS_SMT_STG_DTL C WHERE A.SMT_STATUS IN ('U', 'I') AND ((A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.VOUCHER_ID = C.VOUCHER_ID AND A.PYMNT_CNT = C.PYMNT_CNT AND A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.VOUCHER_ID = B.VOUCHER_ID AND A.PYMNT_CNT = B.PYMNT_CNT AND (B.PYMNT_SELCT_STATUS <> 'N' OR A.PYMNT_GROSS_AMT <> B.PYMNT_GROSS_AMT OR A.NET_SELCT_STATUS <> B.NET_SELCT_STATUS)) OR (A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.VOUCHER_ID = B.VOUCHER_ID AND A.PYMNT_CNT = B.PYMNT_CNT AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.VOUCHER_ID = C.VOUCHER_ID AND A.PYMNT_CNT = C.PYMNT_CNT AND A.PROCESS_INSTANCE < C.PROCESS_INSTANCE AND C.SMT_STATUS IN ('U', 'I')))
|