mysql语法错误
我写了这个简单的查询语句:
INSERT INTO merchants
('firstName','lastName')
VALUES
('Bob','Smith')
听起来很简单,但我不断收到此错误:
`#1064 - 你的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在 ''firstName','lastName' 附近使用的正确语法) 价值观 ('Bob','Smith')' 第 2 行
I wrote this simple query statement:
INSERT INTO merchants
('firstName','lastName')
VALUES
('Bob','Smith')
Sounds very simple but I keep getting this error:
`#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 ''firstName','lastName' )
VALUES
('Bob','Smith' )' at line 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要删除firstName 和lastName 周围的引号:
列名是标识符,因此不加引号。
编辑:列名可以使用反引号(`)引用,但这仅当您的列名包含特殊字符或与 MySQL 关键字匹配的列名时才需要这样做。
You need to remove the quotes from around firstName and lastName:
Column names are identifiers, and as such are not quoted.
Edit: Column names can be quoted using backticks (`), but this is only necessary if you have column names that contain special characters or column names that match MySQL keywords.