更新 MySQL 中的"零"日期时间值



试图将DATETIME值为0000-00-00 00:00:00的mysql行更新为新的日期

UPDATE wp_posts SET post_date = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02'))
and post_date_gmt = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02')) 
WHERE post_date = 0 LIMIT 100
当有数千行0000-00-00 00:00:00值时,更新0行。
UPDATE wp_posts SET post_date = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02')),
       post_date_gmt = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02'))
       WHERE post_date ="0000-00-00 00:00:00" 

相关内容

  • 没有找到相关文章

最新更新