0

这是我的 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

问题已解决。

我的行中有一个额外的逗号。

4

2 回答 2

2

去掉逗号

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')
于 2013-10-23T10:05:53.433 回答
1

插入查询中有一个额外的逗号删除

试试这个::

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)
于 2013-10-23T10:06:33.683 回答