Update only Time in a mysql DateTime field

前端 未结 12 1524
北海茫月
北海茫月 2020-12-09 07:44

How can I update only the time in an already existing DateTime field in MySQL? I want the date to stay the same.

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 08:09

    Try this:

    UPDATE t1 SET DateTimeField = CONCAT(DATE(DateTimeField),' 12:34:56');
    

提交回复
热议问题