1

Accidentally, my host had set the time for 2012 and in my database, there are more than 4000 records updated timestamp column as 2012-11-21 11:24:40.

I cant change time on all columns while updating, I need to keep the same time as per the table column, I just need to change only year 2012 to 2016 in that table.

I listed all columns using this query,

SELECT * FROM `table` WHERE `del_date` LIKE '%2012-11-21%';

but do not know to change the year only in that column.

Please help how can I change the same.

yuri1000
  • 361
  • 4
  • 21

1 Answers1

2

You can use ADDDATE(), like

UPDATE yourTableName SET del_date = ADDDATE(del_date, INTERVAL 4 YEAR);
Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162