替换wordpress WP_POSTS表中post_date字段的年份(4位数)
16lz
2021-01-22
I want to mass replace the 4 digits year inside the field post_date in the wp_posts table.
我想在wp_posts表中大量替换字段post_date中的4位数年份。
Could someone show what the SQL statement should be execute?
有人可以显示应该执行的SQL语句吗?
I want to change from 2011-02-06 17:05:07
to 2012-02-06 17:05:07
, so only the year change from 2011 to 2012.
我想从2011-02-06 17:05:07更改为2012-02-06 17:05:07,所以只有一年从2011年改为2012年。
Thanks,
1 个解决方案
#1
2
UPDATE wp_posts
SET post_date = DATE_ADD(post_date , INTERVAL 1 YEAR)
-- WHERE condition here
- SQLFiddle Demo
SOURCE
- DATE_ADD
更多相关文章
- 如何以varchar字段为编号?
- mysql-求中位数方法
- 常见几种数据库中自增字段的设置方法(转)
- 如何使用jQuery将输入值插入更多填充的字段?
- HTML Select字段通过ajax调用Web服务
- 阻止用户在表单字段中输入
- CORS错误:请求标头字段预检响应中的Access-Control-Allow-Headers
- 如何在选择单选按钮时显示文本字段
- 将输入文本字段显示为纯文本