标签: mysql
我有表:test和字段叫:id。我想要更新时间(例如加2小时),其中id = 1000。怎么做?
答案 0 :(得分:6)
UPDATE test SET time = time + INTERVAL 2 HOUR WHERE id = 1000
使用ADDTIME():
ADDTIME()
UPDATE test SET time = ADDTIME(time, '02:00:00') WHERE id = 1000