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
mehul bhaktaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Not enough information. Post a concise and complete example. Include table DDL and sample data as INSERT statements as runnable script.

Cause: According to your description, there is no need for a loop. Sounds like a simple set-based approach. But without knowing the details, it's hard to give concrete advice.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.