Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 插入到语法错误SQL中_Mysql_Sql - Fatal编程技术网

Mysql 插入到语法错误SQL中

Mysql 插入到语法错误SQL中,mysql,sql,Mysql,Sql,我不知道为什么我会犯这个错误。这可能是我在语法中看不到的东西,因此非常感谢您的帮助 声明 INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, attached_docs, doc_explain, age_met, age_explain, years_met, years_explain, sever

我不知道为什么我会犯这个错误。这可能是我在语法中看不到的东西,因此非常感谢您的帮助

声明

INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, 
                        attached_docs, doc_explain, age_met, age_explain, 
                        years_met, years_explain, severity, severity_explain, 
                        restriction, restriction_explain, require, require_explain) 
VALUES(410, DATE '2009-12-10', 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
       'Dr M Beaulieu has provided further information indicating that applicant is severly ill and disabled. Applican''t condition is confirmed as rectal adenocarcinoma, she has endured dhemo and readiation therapy and is under care of the Oncology Team, surgeon and GP.', 0,
       'Information from Dr states that applicant is unable to sit, has great difficulty walking and requires ongoing support from the Community Support Services',
       0, NULL);
错误

1064-您的SQL语法有错误;检查手册 对应于MySQL服务器版本的正确语法 在“要求”附近使用,要求解释值410,日期 第1行的“2009-12-10”,0,NULL,0,NULL,0,NULL,0,NUL

谢谢。

这是一个要求。必须用反引号将其括起来,如下所示:

`require`
另外,值得指出的是,MySQL使用反斜杠转义单引号,而不是像SQL Server和Access那样的两个单引号。如果上面的SQL语句与您的SQL语句完全相同,且未转义该单引号,则此短语可能会出现问题:

Applican''t condition
这是一个要求。必须用反引号将其括起来,如下所示:

`require`
另外,值得指出的是,MySQL使用反斜杠转义单引号,而不是像SQL Server和Access那样的两个单引号。如果上面的SQL语句与您的SQL语句完全相同,且未转义该单引号,则此短语可能会出现问题:

Applican''t condition

这是因为require是一个关键字反勾选它。

这是因为require是一个关键字反勾选它。

我将您的查询复制粘贴到MySQL Workbench,您似乎正在使用reserved require关键字作为表列的名称,以修复以下问题:

INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, 
                        attached_docs, doc_explain, age_met, age_explain, 
                        years_met, years_explain, severity, severity_explain, 
                        restriction, restriction_explain, `require`, require_explain) 
VALUES(410, DATE '2009-12-10', 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
       'Dr M Beaulieu has provided further information indicating that applicant is severly ill and disabled. Applican''t condition is confirmed as rectal adenocarcinoma, she has endured dhemo and readiation therapy and is under care of the Oncology Team, surgeon and GP.', 0,
       'Information from Dr states that applicant is unable to sit, has great difficulty walking and requires ongoing support from the Community Support Services',
       0, NULL);

我将您的查询复制粘贴到MySQL Workbench,似乎您正在使用reserved require关键字作为表列的名称,以修复此问题:

INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, 
                        attached_docs, doc_explain, age_met, age_explain, 
                        years_met, years_explain, severity, severity_explain, 
                        restriction, restriction_explain, `require`, require_explain) 
VALUES(410, DATE '2009-12-10', 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
       'Dr M Beaulieu has provided further information indicating that applicant is severly ill and disabled. Applican''t condition is confirmed as rectal adenocarcinoma, she has endured dhemo and readiation therapy and is under care of the Oncology Team, surgeon and GP.', 0,
       'Information from Dr states that applicant is unable to sit, has great difficulty walking and requires ongoing support from the Community Support Services',
       0, NULL);

“2009-12-10”这个日期看起来有点不确定。你试过用“2009-12-10”吗?我一直在用DATE做所有的插入,效果很好。很抱歉,我在考虑sql server语法,即使你明确提到mysql=/日期“2009-12-10”看起来有点不确定。你试过“2009-12-10”吗?我在所有的插入中都使用了DATE,效果很好。很抱歉,我在考虑sql server语法,即使你明确提到mysql=/+1。为什么人们总是比我快;顺便说一句,通常情况下,在MySQLI中总是反引用标识符名称并没有什么坏处。我只是从access中导出了“值”部分中的数据,所以我想这就是他们的做法。@Datacommie您可能需要对\'+1进行搜索/替换。为什么人们总是比我快;顺便说一句,在MySQLI中总是反引用标识符名称通常不会有什么坏处。我只是从access中导出了“值”部分中的数据,所以我想这就是他们的工作方式。@Datacommie您可能需要搜索/替换