Bajlo Bajlo - 1 year ago 92
MySQL Question

Update date + one year in mysql

When I want setting numerical value +1 in mysql table, I use e.g.:

UPDATE table SET number=number+1 WHEN ...


How can I set date + one year?

Thanks

Answer Source

You could use DATE_ADD : (or ADDDATE with INTERVAL)

UPDATE table SET date = DATE_ADD(date, INTERVAL 1 YEAR)