How to add one year to mysql date
This article mainly introduces how to add one year to the mysql date, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
The way to add a year to a mysql date: add one year to the date, and use the updata update statement with the code [UPDATE table SET date = DATE_ADD (date, INTERVAL 1 YEAR)].
Mysql date plus one year method:
Update siteserver_content_57 set AddDate=DATE_ADD (AddDate,INTERVAL 2 year), LastHitsDate=DATE_ADD (LastHitsDate,INTERVAL 2 YEAR)
There are fields in the mysql table that show the date. Due to various needs, it needs to be adjusted one year later.
Add one year's update statement to the mysql date. The update statement is as follows:
UPDATE table SET date = DATE_ADD (date, INTERVAL 1 YEAR)
If you want to add one day, the next 1 YEAR becomes 1 DAY, and 1 MONTH in January
Note that if it is years or months or days, such as 3 years
Followed by 3 YEAR, there is no need for the plural. So don't write as 3 YEARS Novell fans, Novell fans.
Thank you for reading this article carefully. I hope it will be helpful for everyone to share the mysql date and how to add one year's content. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you have any problems. Detailed solutions are waiting for you to learn!