在mysql DateTime字段中仅更新时间 [英] Update only Time in a mysql DateTime field

查看:71
本文介绍了在mysql DateTime字段中仅更新时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何仅更新MySQL中已经存在的DateTime字段中的时间?我希望日期保持不变.

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

推荐答案

尝试一下:

UPDATE yourtable SET yourcolumn=concat(date(yourcolumn), ' 21:00:00') WHERE Id=yourid;

这篇关于在mysql DateTime字段中仅更新时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆