Sam Grant
Sam Grant

Reputation: 442

Change Time Field for specific Rows in mySQL DB

Anyone have any suggestions for an SQL statement that will change a time field for a filtered set of rows?

I have about 1500 rows that have a time column. I need to subtract 4 minutes from every row that has a certain user id...

Suggestions?

Upvotes: 0

Views: 50

Answers (1)

Ed Gibbs
Ed Gibbs

Reputation: 26343

If the column is a TIME type then the ADDTIME function will work. Just use a negative 'hour:minute':

ADDTIME(my_column, '-0:04')

Upvotes: 1

Related Questions