Having this rows:
1|2015-04-22
2|2015-03-11
3|2015-02-15
I want update on all rows just the day, example:
1|2015-04-25
2|2015-03-25
3|2015-02-25
It looks like you want to keep the year and month the same, and change all the days to the 25th of whichever year and month are shown.
The formula you need is
DATE(DATE_FORMAT(datecolumn, '%Y-%m-25'))
So, to update the table it's
UPDATE mytable SET datecolumn = DATE(DATE_FORMAT(datecolumn, '%Y-%m-25'))
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments