【问题标题】:replace the year (4 digits) of the post_date field in wordpress WP_POSTS Table替换 wordpress WP_POSTS 表中 post_date 字段的年份(4 位数字)
【发布时间】:2013-01-17 03:07:22
【问题描述】:

我想批量替换 wp_posts 表中字段 post_date 内的 4 位数年份。

有人能说明应该执行什么 SQL 语句吗?

我想从 2011-02-06 17:05:07 更改为 2012-02-06 17:05:07 ,所以只有年份从 2011 更改为 2012。

谢谢,

【问题讨论】:

    标签: mysql sql wordpress sql-update


    【解决方案1】:
    UPDATE wp_posts 
    SET post_date = DATE_ADD(post_date , INTERVAL 1 YEAR)
    -- WHERE condition here
    

    来源

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-14
      • 1970-01-01
      相关资源
      最近更新 更多