Adding days to a date
I am have a column of dates that I need to add a variable amount of days to. So I don't think I can use the normal date_add (date, interval x day).
date numOfDays
2001-01-01 5
2001-05-22开发者_开发百科 3
2002-03-04 2
... ...
I'm basically looking for something like:
select date, numOfDays, (date + numOfDays) as newDate
from t1;
SELECT `date`,
`numOfDays`,
(`date` + INTERVAL `numOfDays` DAY) AS `newDate`
FROM `t1`;
精彩评论