I have a table that lists Dates as 110427 in Date col.
I Have a days col, which is days form today.
This sql gets all my dates:
SELECT DISTINCT date FROM test.op;
This Sql gets days from today:
SELECT TO_DAYS('20110430') - TO_DAYS(NOW());
How do I loop an update?
Where result would
Date Days
110430 3
110530 33
Would use an if or case?
How about this?
This would update each row’s
Dayscolumn to have the value from the the row’sdatecolumn run through your subtraction.