比如时间为 “2014-12-11 13:12:01”
修改为“2014-09-26 13:12::01”
修改内容为修改yyyy-mm-dd为对应的日期,时间不变。
UPDATE result_road_saturation
SET BEGIN_TIME = ADDTIME(
date('2014-09-26') + INTERVAL 0 HOUR,
time(BEGIN_TIME)
),
END_TIME = ADDTIME(
date('2014-09-26') + INTERVAL 0 HOUR,
time(END_TIME)
),
UPDATE_TIME = ADDTIME(
date('2014-09-26') + INTERVAL 0 HOUR,
time(UPDATE_TIME)
)
WHERE
BEGIN_TIME >= '2014-09-26'
AND BEGIN_TIME < '2014-09-27'
其中BEGIN_TIME 格式为datetime
若想修改为当前的日期,则为
UPDATE result_road_saturation set BEGIN_TIME = ADDTIME (CURDATE() + interval 0 hour,time(BEGIN_TIME))