Avatar of mehul bhakta
mehul bhakta

asked on 

Oracle SQL Loop with date change

hello all

I create this stage table with how customers looked on '01-JAN-2016', this table then goes through to other tables to see how they looked on that day. for example were they activated for online use on '01-JAN-2016', how did they pay etc.

I then dump all that data into one table with a from_date with the day they joined the company and a default to_date of '31-DEC-9999', then I repeat this process for '02-JAN-2016' and compare the two tables, if there was a change I'd make the to_date of line one '01-JAN-2016' so the from_date of line two is '02-JAN-2016' and now the to_date is '31-DEC-9999'.

I want to be able to repeat this process until the present day.

is this possible in SQL?

Many Thanks

Mac
example-customer.xlsx
SQL

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon