Good evening, This is a follow up issue to my original question in regards to returning accounts not present for 10 days. http://www.experts-exchange.com/Database/Oracle/Q_28386607.html
Guy Hengel [angelIII / a3]
select a.*, t.transaction_date
from account_table a
join transaction_table t
on t.accountnumber = a.accountnumber
and t.transaction_date < trunc(sysdate -10 )
where not exists ( select null from transaction_table n
where n.accountnumber = a.accountnumber
and n.transaction_date > t.transaction_date
and n.transaction_date <= t.transaction_date + 10
I’ve had a new requirement added to where i must first get a list of accounts that are present in the account table for 10 consecutive days prior to joining to the transaction table to see if the account is present in the past 10 days.
Data is not loaded to the tables on sundays so all sundays have to be omitted from the 10 consecutive days logic from the accounts table.
Thanks for your assistance!