sdfh54nf5
sdfh54nf5

Reputation: 45

How to update time in mysql by ADDTIME()?

I have table: test and field called: id. I want update time (ex. add 2 hours) where id=1000. How to do this?

Upvotes: 2

Views: 4353

Answers (1)

eggyal
eggyal

Reputation: 125865

UPDATE test SET time = time + INTERVAL 2 HOUR WHERE id = 1000

Using ADDTIME():

UPDATE test SET time = ADDTIME(time, '02:00:00') WHERE id = 1000

Upvotes: 7

Related Questions