gpt4 book ai didi

sql-server - 我有一个不正确的语法错误

转载 作者:行者123 更新时间:2023-12-02 19:10:53 24 4
gpt4 key购买 nike

INSERT INTO FoodLog
(Person,Food,ServingSize,Date,Meal)
VALUES
('John','Cheerios',2,'1-APR-2014','Breakfast')
('John','TBoneSteak',1,'2-APR-2014','Lunch')

在这段代码中,第一行代码工作得很好,但是当我用相同的人名输入第二行代码时,它不接受它。

这是我收到的错误:

Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'John'.

最佳答案

为了得到答案而不是评论。正如 @helderdarocha 所说,“你在行与行之间缺少一个逗号。”

INSERT INTO FoodLog (Person,Food,ServingSize,Date,Meal)
VALUES ('John','Cheerios',2,'1-APR-2014','Breakfast')
,('John','TBoneSteak',1,'2-APR-2014','Lunch')

关于sql-server - 我有一个不正确的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23165036/

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