We help IT Professionals succeed at work.
Get Started

Oracle SQL Loop with date change

mehul bhakta
mehul bhakta asked
on
105 Views
Last Modified: 2018-05-14
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
Comment
Watch Question
Senior Developer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE