mysql设置始终修改更新时间字段

`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'

当然如果直接更新这个字段,则会失效。 UPDATE XXX SET aa = '123',update_time=update_time  WHERE id= 2513;

猜你喜欢

转载自blog.csdn.net/yunxing323/article/details/109565557