Bajlo Bajlo - 2 months ago 21
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

You could use DATE_ADD : (or ADDDATE with INTERVAL)

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