Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有表:测试和名为:id 的字段。我想要更新时间(例如添加 2 小时),其中 id=1000。这该怎么做?
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