当前位置:网站首页>sql语句 异常 Err] 1064 – You have an error in your SQL syntax; check the manual that corresponds to your
sql语句 异常 Err] 1064 – You have an error in your SQL syntax; check the manual that corresponds to your
2022-08-10 13:44:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
在我们开发的工程中,有时候会报 [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
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/130032.html原文链接:https://javaforall.cn
边栏推荐
猜你喜欢
Lack of comparators, op amps come to the rescue!(Op amp is recorded as a comparator circuit)
How does IT Xiaobai learn PHP systematically
矩阵键盘&基于51(UcosII)计算器小项目
高数_证明_弧微分公式
八大排序总是忘?快来这里~
【学习笔记】Redis的持久化
网络安全——XSS之被我们忽视的Cookie
记录几道整型提升的题目
2022年五大云虚拟化趋势
2022-08-09: What does the following go code output?A: No, it will panic; B: Yes, it can run correctly; C: Not sure, see the voting result.package main import (“fmt“ “syn
随机推荐
递归递推之Fighting_小银考呀考不过四级
什么?你还不会JVM调优?
OpenStack-related commands that need to be recorded _ self-use
Using data intelligence, Amazon cloud technology helps companies build endogenous brand growth
Code Casual Recording Notes_Dynamic Programming_70 Climbing Stairs
数据产品经理那点事儿 一
Data product manager thing 2
BEVDet4D: Exploit Temporal Cues in Multi-camera 3D Object Detection Paper Notes
借数据智能,亚马逊云科技助力企业打造品牌内生增长力
AWS Security Fundamentals
Vivado crashes or the message is not displayed
A can make large data clustering method of 2000 times faster, don't poke
C# InitializeComponent() does not exist in the current context
WebView的优化与常见问题解决方案
tampercfg内核模块导致机器频繁crash
【学习笔记】Redis的持久化
Fragment的show和hide
Summary of Force Buckle Solution 640 - Solving Equations
【POI 2008, BLO】割点
the height of the landscape