gpt4 book ai didi

sql - 仅更新 mysql DateTime 字段中的时间

转载 作者:IT老高 更新时间:2023-10-28 23:41:41 29 4
gpt4 key购买 nike

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

最佳答案

试试这个:

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

关于sql - 仅更新 mysql DateTime 字段中的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1326548/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com