gpt4 book ai didi

MYSQL日期时间插入问题

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

这是我的sql行

我试过了:

INSERT INTO delivery (Manifest_Id, , Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP',2013-10-23 14:00:00,2013-10-23 18:00:00)

和这个

INSERT INTO delivery (Manifest_Id, , Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP','2013-10-23 14:00:00','2013-10-23 18:00:00')

都返回我

 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP',2013-10' at line 1

我的表结构是

delivery_id as int with auto increment ( not the issue )
Manifest_id as varchar
Expected_Start_DateTime as datetime
Expected_End_DateTime as datetime

问题已解决。

我的行中多了一个逗号。

最佳答案

去掉逗号

INSERT INTO delivery(Manifest_Id, Expected_Start_DateTime, Expected_End_DateTime)
VALUES ('SGP1361645SGP','2013-10-23 14:00:00','2013-10-23 18:00:00')

关于MYSQL日期时间插入问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19538675/

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