SELECT
c.*
FROM
AVERAGE_DAILY_OVERDRAFT c,CUSTOMER_ACCOUNT_INFORMATION b
WHERE
TO_DATE (c.YEAR||c.MONTH, ‘YYYYMM‘) <![CDATA[ <= ]]>SYSDATE
AND TO_DATE (c.YEAR||c.MONTH, ‘YYYYMM‘) > ADD_MONTHS (SYSDATE, - 6)
AND not EXISTS(
select * from AVERAGE_DAILY_OVERDRAFT a where a.ACCOUNT_NUMBER = c.ACCOUNT_NUMBER
and a.ALL_DUE_STATUS = 0
)
AND c.ACCOUNT_NUMBER=b.ACCOUNT_NUMBER
and c.TOTAL_AMOUNT_OVERDRAFT/b.CREDIT_AMOUNT >=0.5
时间: 2024-10-17 23:40:56