MySQL DATETIME - Change only the date

后端 未结 6 1129
执笔经年
执笔经年 2020-12-28 17:03

Starting with : 2011-01-17 09:30:00

Let\'s say I want to edit just the date with 2011-01-28

What is the most efficient way to end up with: 2011-01-28 09:30:0

6条回答
  •  余生分开走
    2020-12-28 17:38

    Check Query

     update yourtable set eventtime=replace(eventtime,substr(eventtime,1,10), '2013-07-17')  WHERE  `id`=4
    

提交回复
热议问题