当有数千行
试图将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"