1.将某时间字段数据进行减一天,然后赋值给其他时间字段列

update t_sg_spraygun_running c set c.day_time = DATE_SUB(c.create_time, INTERVAL 1 DAY) 

 

  参考:cnblogs.com/geek233/p/16112906.html

 

2.某时间字段格式化后,重新赋值

update t_sg_spraygun_running c set c.create_time = date_format(create_time,'%Y-%m-%d 00:00:00') where id in(2, 72);

 

 posted on 2022-08-11 10:59  曹军  阅读(20)  评论(0编辑  收藏  举报