Add DATE and TIME fields to get DATETIME field in MySQL

后端 未结 4 947
無奈伤痛
無奈伤痛 2021-01-11 23:16

I am trying to get a DATETIME field from a DATE and a TIME field. none of the functions in MYSQL seems useful.

Is somebody aware how to do this or that if this can e

4条回答
  •  再見小時候
    2021-01-11 23:30

    It should be as easy as

    UPDATE table SET datetime_field = CONCAT(date_field, " ", time_field);
    

提交回复
热议问题