Sincere apologies if this has been treated in the past. I cannot seem to find it on Stackoverflow.
I want my SQL code to return session_id 6. Reasons being that it is on “inward” Table but not on “Wallet” Table and also on “pending_wallet” Table with status as ’00’. ’00’ means successful in this context.
At the end. The intention is to make sure all transactions in “inward” Table makes it to “wallet” Table as long as it is
not on “pending_wallet” Table or it is on “pending_wallet” Table but with status set to ’00’. All transactions on inward table should eventually make it to wallet table.
SQL I have is:
SELECT session_id FROM INWARD WHERE beneficiary_account_no LIKE '460%'
AND transaction_date > '2024-06-06' AND transaction_date < '2024-06-08 00:00:30'
from inward
left join pending_wallet on inward.SESSION_ID = pending_wallet.session_id
left join wallet on inward.SESSION_ID = wallet.session_id
where pending_wallet.SESSION_ID is NULL AND pending_wallet.session_id = '00';