gpt4 book ai didi

mysql - 如何在mysql中插入当前时间

转载 作者:太空宇宙 更新时间:2023-11-03 12:03:06 24 4
gpt4 key购买 nike

如何编写 mysql 查询来插入当前时间和 future 时间?

future 时间应比当前时间晚 5 分钟。

我有这个:

insert into ab(id, time, future_time) VALUES (1, 'NOW()', NOW());

感谢任何帮助。

最佳答案

尝试以下操作:

insert into ab(id, time, future_time) VALUES (1, now(), date_add(now(), INTERVAL 5 MINUTE));

我这里没有MySql,无法验证,可以引用here了解详情。

关于mysql - 如何在mysql中插入当前时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28021863/

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