mysql - 有人可以告诉我这段sql代码做错了什么吗

标签 mysql sql

Insert into DonutOrder (Date, Special Handling Notes)
Values ("20140506", "Please Include Plates and Napkins");

我不断收到这样的回复 错误 SQL查询:

Insert into DonutOrder (Date, Special Handling Notes);

MySQL 说:文档

#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 'Handling Notes)' at line 1

最佳答案

嗯,你的标识符(列名)有空格,所以你应该用反引号转义它:

insert into `DonutOrder` (`Date`, `Special Handling Notes`) Values ("20140506", "Please Include Plates and Napkins");

关于mysql - 有人可以告诉我这段sql代码做错了什么吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33379132/

相关文章:

php - 如何用数组查询mysql表?

sql - Access VBA 字符串以根据匹配条件返回最小和最大日期

mysql - 从数据库中选择多个计数

IPN 的 PHP 自定义变量

mysql - 在 Ubuntu 18.04 上安装 MySQL 8.0 时遇到问题

php - 如何将预先存在的类别和产品转换为 SEO 友好的 URL

sql - PL/SQL 处理多个 notfound exptions +constraint violations

mysql - 在 MySQL 查询中的 SELECT 中使用 SELECT

c# - 从 SQL Server (CE) 中的数字中获取正确 n 位的最佳方法

sql - Oracle 正则表达式替换多次出现的用逗号包围的字符串