-
sql语句 异常 Err] 1064 - You have an error in your SQL ... check the manual that corresponds to your
2019-07-09 10:33:44在我们开发的工程中,有时候会报 ... check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...在我们开发的工程中,有时候会报
[Err] 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 ------
这种异常 不用多想,肯定是我们的sql语句出现问题,下面我只说我经常犯的一种错误。当然还有很多种错误,我们遇到再说。
这时候 我们不难发现 错误的原因是我们这里多了一个 ,号有时候也会出现这种错误 [Err] 1054 - Unknown column ‘----------’ in 'field list’
这时候是我们的字段写错了 我们会发现数据库中并没有这个字段 而是我们的字段写错了下面为大家写上两个同级sql
select a.Attribute_Id as Attribute_Id, a.Attribute_Name as Attribute_Name, a.Attribute_Alias as Attribute_Alias, a.Attribute_Unit as Attribute_Unit, a.DeviceType_Id as DeviceType_Id, a.SortCode as SortCode, a.UpdateTime as UpdateTime, a.isdel as isDel from zz_deviceattribute as a where Attribute_Id in( select Attribute_Id from ZZ_DeviceAttributeRelation where Device_Id = '05871a37-a242-40f9-bbea-33bdea7009d5')
select distinct a.Attribute_Id as Attribute_Id, a.Attribute_Name as Attribute_Name, a.Attribute_Alias as Attribute_Alias, a.Attribute_Unit as Attribute_Unit, a.DeviceType_Id as DeviceType_Id, a.SortCode as SortCode, a.UpdateTime as UpdateTime, a.isdel as isDel from ZZ_DeviceAttributeRelation as b inner join zz_deviceattribute as a on a.Attribute_Id = b.Attribute_Id where b.Device_Id = '05871a37-a242-40f9-bbea-33bdea7009d5' and a.isDel ='0' order by a.SortCode
欢迎大家加入技术群聊 -
解决办法汇总:You have an error in your SQL syntax; check the manual that corresponds to your MySQL
2019-02-20 20:09:17最近在弄一个项目,有一处需求是要求PC读取信息并写入... check the manual that corresponds to your MySQL server version for the right syntax to use near '1)' at line 1的报错,在网上找了好久,也没有解...最近在弄一个项目,有一处需求是要求PC读取信息并写入数据库
其中遇到了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 '1)' at line 1的报错,在网上找了好久,也没有解决。后来自己查了很多资料,才得以解决,现在根据自身加以总结。
1、单引号、反单引号分不清
java中键值用(‘)单引号,列名(`)反单引号。就是上面一排数字键最左边~符号那个,切换英文输入法即为反单引号。
比如
int result = ed.insertData("insert into information(`nowtime`,`data`) values(current_time,'A');");
insertData就是负责执行这句SQL语句的,他最后返回受影响的条数,这个不用管。
其中列名分别是nowtime和data(这里用反单引号),写入数据库的值是current_time和字符A(这里用单引号)。
2、列名包括SQL关键字
解决办法:修改表名字,比如你的列名不能叫做update等关键字
3、语法真的错了
这个一般都能看出来
然而楼主看了一下午,我的语句没问题啊!!!!!
后来发现个事
4、注意你的语句是不是忘记空格了!
比如下面这个报错
int result = ed.insertData("insert "+"into testtest" + "values(1) ");
而把代码合成一句话执行就没问题了
int result = ed.insertData("insert into testtest values(1) ");
当初死活想不明白,后来经过评论区才恍然大悟
第一句话的testtest和后面的values之间没有空格!!!!所以当然会报错了
所以诸位要注意下你们是不是也是忘记了空格,这个错误经常发生在换行的时候,
所以短小的SQL语句还是写成一句话比较好,减少bug产生效率哈哈
BUG深似海,一个一整天。
-
MySQL运行SQL文件时(全面,改成time):check the manual that corresponds to your MySQL server version...
2019-03-16 08:28:35Mysql错误:check the manual that corresponds to your MySQL server version for the right syntax【加 `符号、修改有冲突的字段名】 check the manual that corresponds to your MySQL server version for the ...参考:
Mysql错误:check the manual that corresponds to your MySQL server version for the right syntax【加 `符号、修改有冲突的字段名】
check the manual that corresponds to your MySQL server version for the right syntax错误【字段名用了关键字】
check the manual that corresponds to your MySQL server version for the right syntax to use near【where前多加了逗号】
Mysql异常check the manual that corresponds to your MySQL server version for the right syntax总结【sql是否有中文字符 、是否与关键字冲突、是否含特殊字符、是否正确分行】
这些文章里的答案都没有解决我的问题!!!
后面我使用“MySQL的工作台workspace8.0”,运行SQL文件,要是遇到的错误,会有红色下划线提示,发现:(SQL文件的时间有问题)
不是insert语句有问题,也不是create创建有问题,而是时间类型有问题,无论是datetime还是time,Navicat premium工具转储数据表的结构,时间后面都会带“(0)”!!!
改:
把datetime(0)全替换成datetime或time(0)【如图所示,在xx.sql中,手动修改】:
-
manual
2012-05-09 22:58:57 -
check the manual that corresponds to your MySQL server version for the right syntax to use near
2018-06-29 20:05:41check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 价格=11' at line 1注意这种一般情况下是语法问题,说明mysql的各种语句还是不够熟练,(1)看表名... -
qmake manual
2016-05-29 18:52:42由官网网页这里的qmake manual,版本为5.6 。供大家线下学习使用。 -
Cmake manual
2014-04-28 22:17:18CMake Manual cmake - Cross-Platform Makefile Generator. -
C Reference Manual.pdf
2019-08-04 13:35:20C Reference Manual,C Reference Manual,C Reference Manual,C Reference Manual -
PRINCE2 Manual
2017-10-11 09:29:58Manual for PRINCE2 Foundation and Practitioner (PDF) -
Linux System Network Management Manual
2018-05-06 00:35:10Linux System Network Management Manual -
ARM Architecture Reference Manual
2018-05-03 09:03:37ARM Architecture Reference Manual、ARMv7-M Architecture Reference Manual、《ARM+Architecture+Reference+Manual》中文版.pdf -
Maple 2019 User Manual.pdf
2019-12-20 17:16:08Maple 2019 User Manual Maple 2019 User Manual Maple 2019 User Manual Maple 2019 User Manual -
Qt Installer Framework Manual : Qt Installer Framework Manual
2019-10-06 01:21:12Qt Installer Framework Manual : Qt Installer Framework Manual Qt Installer Framework Manual : Qt Installer Framework ManualVersion 1.... -
0.2.0-beta manual
2020-11-27 16:58:56<div><p>See issue #248 for more information about the manual's content <p>Now using ReadTheDocs for generating the manual, thanks for getting it rolling. <p>CubicSDR Manual Repository: - ... -
MongoDB-Manual
2013-03-26 10:55:08MongoDB Manual 来自MongoDB官网 -
ACTEX Exam P Manual
2018-04-23 03:47:30这是Actex Exam P的manual,正版的, 新版的, 虽然不是最新版,但是,和最新版几乎一模一样,考试用完全没问题 -
RTC5_Manual.zh.pdf
2020-01-02 21:46:08RTC5 Scanlab Manual 手册 RTC5 Scanlab Manual 手册 RTC5 Scanlab Manual 手册 RTC5 Scanlab Manual 手册 RTC5 Scanlab Manual 手册 -
STM32 Reference Manual
2015-01-15 19:07:24STM32 Reference Manual -
Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your My
2017-11-04 16:56:43Query : select * from order LIMIT 0, 1000 Error Code : 1064 ... check the manual that corresponds to your MySQL server version for the right syntax to use near 'order LIMIT 0, 1000' at line 1 -
ANSYS Fluent UDF Manual 16.0.zip
2019-07-30 13:39:10ANSYS Fluent UDF Manual 16.0.PDF ANSYS Fluent UDF Manual -
Flac3D 3.0 Manual
2016-04-11 22:34:20FLAC3D 3.0版本manual整合,带书签。 -
Lua 5.3 Reference Manual
2016-01-14 17:03:45Lua 5.3 Reference Manual,不多说了 -
PyTorch | torch.manual_seed(1)是什么意思?torch随机数manual_seed(1)有什么用?如何理解torch.manual_...
2020-11-03 17:22:58torch.manual_seed(1)是为了设置CPU的的随机数固定,使得紧跟着的rand()函数生成的值是固定的随机! # 王博Kings import torch torch.manual_seed(1) print(torch.rand(5)) tensor([0.7576, 0.2793, 0.4031, 0... -
GNU Emacs Manual mobi
2013-11-12 22:53:19这是GNU Emacs Manual的mobi版,Kindle用户大爱,不过Manual就是Manual不是什么实例教程。 -
ANSYS FLUENT UDF Manual
2015-07-28 09:10:48完整版的ANSYS FLUENT UDF Manual -
RM0008 Reference Manual
2017-12-15 15:56:08本手册是STM32微控制器产品的技术参考手册RM0008 Reference Manual 英文第10版,技术参考手册是有关如何使用该产品的具体信息,包含各个功能模块的内部结构、所有可能的功能描述、各种工作模式的使用和寄存器配置等... -
Bash Reference Manual
2019-05-17 19:27:10Bash Reference Manual http://www.gnu.org/software/bash/manual/bash.html 1. Table of Contents 1 Introduction 1.1 What is Bash? 1.2 What is a shell? 2 Definitions 3 Basic Shell Features 3.1 Shell ... -
FreeMarker Manual.pdf
2011-07-18 22:57:03FreeMarker Manual.pdfFreeMarker Manual.pdfFreeMarker Manual.pdfFreeMarker Manual.pdfFreeMarker Manual.pdf -
三菱Safety Manual.part3.rar
2019-09-15 19:56:38三菱Safety Manual.part3rar,三菱Safety Manual.part3 -
PFC 5.0 Manual手册版
2017-11-09 16:05:20PFC 5.0 Manual,具体介绍pfc 5.0.21的安装,运用以及与之前版本的区别
-
ELF视频教程
-
基于对偶四元数的姿轨耦合动力学模型1.md
-
Python爬虫零基础最全入门课程
-
jquery 如何判断是否为整数
-
FTP 文件传输服务
-
自媒体搞笑音效和段子素材
-
centos7.6.1810之 docker安装mysql:8.0.23
-
零基础一小时极简以太坊智能合约开发环境搭建并开发部署
-
【ACWing】1023. 买书
-
react中qs是什么
-
2013-2020矩阵代数往年试题.zip
-
维纳尔.电气设备选型资料大全 (适合刚刚入行的电气工程师对设备进行选型规划)详解
-
FFmpeg4.3系列之16:WebRTC之小白入门与视频聊天的实战
-
BD 方案 .pdf
-
linux c i2c总线 通信 源代码
-
C语言零基础入门(详细讲解)
-
项目经理成长之路
-
2021年 系统架构设计师 系列课
-
iOS视频硬编码技术
-
牛牛量化策略交易