Saad Ahmed Saad Ahmed - 3 years ago 78
SQL Question

Time type column field data update in mysql

I have a time type column in database and i want to update current stored value.
I wrote this query but data is not changed.

UPDATE testing SET timevall = timevall + "06:00:00" WHERE timevall > "00:00:00"

Kindly help me.
Thanks

Answer Source

try this query its work fine for you..

update testing set timevall=now() WHERE timevall > "00:00:00";

its store current time in timevall..

try this its works and gives output which youwant

UPDATE testing SET timevall = ADDTIME(timevall, '12:00:00') WHERE timevall > '00:00:00';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download