gpt4 book ai didi

mysql - mysql工作台导入错误: missing closing parenthesis

转载 作者:行者123 更新时间:2023-11-29 12:28:39 25 4
gpt4 key购买 nike

快要拔掉我的头发了。在 Frankie 下出现错误,说我“缺少右括号”。见下文:

INSERT INTO storelocals (id, name, address, lat, lng)
values(Frankie Johnnie & Luigo Too,"939 W El Camino Real, Mountain View,CA",37.386339,-122.085823
Amici's East Coast Pizzeria,"790 Castro St, Mountain View, CA",37.38714,-122.083235
Kapp's Pizza Bar & Grill,"191 Castro St, Mountain View, CA",37.393885,-122.078916
Round Table Pizza: Mountain View,"570 N Shoreline Blvd, Mountain View, CA",37.402653,-122.079354
Tony & Alba's Pizza & Pasta,"619 Escuela Ave, Mountain View, CA",37.394011,-122.095528
Oregano's Wood-Fired Pizza,"4546 El Camino Real, Los Altos, CA",37.401724,-122.114646
Round Table Pizza: Sunnyvale-Mary-Central Expy,"415 N Mary Ave, Sunnyvale, CA",37.390038,-122.042034
Giordano's,"730 N Rush St, Chicago, IL",41.895729,-87.625411
Filippi's Pizza Grotto,"1747 India St, San Diego, CA",32.723831,-117.168326
Pizzeria Paradiso,"2029 P St NW, Washington, DC",38.90965,-77.0459
Tutta Bella Neapolitan Pizzera,"4918 Rainier Ave S, Seattle, WA",47.557704,-122.284985
Touche Pasta Pizza Pool,"1425 NW Glisan St, Portland, OR",45.526465,-122.68558
Piecora's New York Pizza,"1401 E Madison St, Seattle, WA",47.614005,-122.313985
Pagliacci Pizza,"550 Queen Anne Ave N, Seattle, WA",47.623942,-122.356719
Zeeks Pizza - Phinney Ridge,"6000 Phinney Ave N, Seattle, WA",47.67267,-122.354092

最佳答案

您需要将要插入的每组值(每行)括起来,并且需要将字符串文字括在引号中。

要插入单行,请将值括在左括号和右括号内,例如

INSERT INTO storelocals (name, address, lat, lng) VALUES
('Frankie Johnnie & Luigo Too',"939 W El Camino Real, Mountain View, CA",37.386339,-122.085823)

要插入多行,可以用逗号分隔行(我认为这基本上是在每个后​​续行之前用逗号替换第一行(INSERT ... VALUES 行):

INSERT INTO storelocals (name, address, lat, lng) VALUES
('Frankie Johnnie & Luigo Too',"939 W El Camino Real, Mountain View, CA",37.386339,-122.085823)
,
('Amici''s East Coast Pizzeria',"790 Castro St, Mountain View, CA",37.38714,-122.083235)
,
('Kapp''s Pizza Bar & Grill',"191 Castro St, Mountain View, CA",37.393885,-122.078916)

请注意,空格(例如换行符)不会影响语句,我只是添加换行符以更好地展示语法。请注意每个数据“行”周围的左括号和右括号,并注意用单引号括起来的字符串文字中的单引号需要通过在前面添加额外的单引号来“转义”。例如,字符串文字:

'Amici''s'

计算结果为

Amici's
<小时/>

编辑

INSERT 语句中的列列表必须与为行提供的值列表相匹配。 (第一行值进入第一列,第二个值进入第二列,依此类推。

在 OP 语句中,似乎没有为引用的 id 列提供值。

因此,对 id 列的引用应该从列列表中删除。或者,值列表需要包含该列的值。关键字NULL可用于指定“null”值。

关于mysql - mysql工作台导入错误: missing closing parenthesis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27912625/

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