I have a oracle sql where I do an outer join between the accounts table and payments table. I want to know how to execute the condition p.payment_status_code = ‘R’ only when there is a matching record in the payments table. For the rest, the condition should not be executed.
FROM
accounts a, payments p
WHERE (a.account_balance <= a.low_balance_level OR a.account_balance <= 0)
AND a.account_id = p.account_id(+)
AND p.payment_status_code = 'R'
Regards,
-Anand
1 Answer