tags:

views:

118

answers:

1

I have a table with a column called time, "HH:MM:SS". How can I do a batch update so that the value increment by 1 hour?

Is it something like:

update <table_name> set <time_column> = <time_column> + 3600 where ...
+2  A: 

Assuming that your time_column is a string (varchar/etc), use the ADDTIME function to increment the time value by an hour:

UPDATE table_name
   SET time_column = ADDTIME(time_column, '01:00:00')
 WHERE ...
OMG Ponies
the time column is a 'time'.. what shld i do, then?
Yang
The query should work fine if it's a TIME column as well.
Chad Birch