当前位置:网站首页>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
边栏推荐
- 【219】慕课三千多的那个go工程师的培训课笔记 02 go语言的编程思想
- Interface Automation Testing Basics
- 3DS MAX 批量导出文件脚本 MAXScript 带界面
- 图式图例规范尺寸
- NAACL 2022 | 简单且高效!随机中间层映射指导的知识蒸馏方法
- C# error The 'xmins' attribute is not supported in this context
- M²BEV: Multi-Camera Joint 3D Detection and Segmentation with Unified Bird’s-Eye View Representation
- 【MinIO】工具类使用
- SenseTime self-developed robotic arm, the first product is an AI chess-playing robot: Guo Jingjing is also invited as an endorsement
- 接口自动化测试基础篇
猜你喜欢
Existing in the rain of PFAS chemical poses a threat to the safety of drinking water
[target detection] small script: extract training set images and labels and update the index
MySQL - 数据库的存储引擎
Short read or OOM loading DB. Unrecoverable error, aborting now
八大排序总是忘?快来这里~
实现一个深克隆
bgp dual plane experiment routing strategy to control traffic
Ethernet channel Ethernet channel
AWS Security Fundamentals
Interface Automation Testing Basics
随机推荐
Calculate the number of combinations recursively
C#报错 The ‘xmins‘ attribute is not supported in this context
Ethernet channel Ethernet channel
【MinIO】工具类使用
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer Paper Notes
X5WebView使用
这一次,话筒给你:向自由软件之父斯托曼 提问啦!
NAACL 2022 | 简单且高效!随机中间层映射指导的知识蒸馏方法
递归递推之Fighting_小银考呀考不过四级
数据产品经理那点事儿 一
Matlab画分段函数「建议收藏」
高数_证明_曲率公式
1W word detailed thread local storage ThreadLocal
1W字详解线程本地存储 ThreadLocal
I would like to ask the big guys, how to solve this error when cdc oracle initializes a 3 million table task running
Cloud Migration Practice of Redis
Lithium battery technology
AWS Security Fundamentals
ES5和SE6来实现一个Promise效果
友邦人寿可观测体系设计与落地