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在我们开发的工程中,有时候会报[Err]1064-YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfortherightsyntaxtousenear——这种异常不用多想,肯定是我们的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

在这里插入图片描述
欢迎大家加入技术群聊

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/130032.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • C++面试

    C++面试C++面试

    2022年4月22日
    48
  • APP弱网测试[通俗易懂]

    APP弱网测试[通俗易懂]APP弱网测试 一、网络测试的一般流程step1:首先要考虑网络正常的情况① 各个模块的功能正常可用② 页面元素/数据显示正常step2:其次要考虑无网络的情况① APP各个功能在无网络情况下是否可用② APP各个页面之间切换是否正常③ 发送网络请求时是否会导致闪退、卡死等异常情况④ APP各个页面是否显示完整美观,未刷新的页…

    2022年4月19日
    36
  • Broadcasts —–Security considerations and best practices「建议收藏」

    Broadcasts —–Security considerations and best practices「建议收藏」Herearesomesecurityconsiderationsandbestpracticesforsendingandreceivingbroadcasts:Ifyoudon’tneedtosendbroadcaststocomponentsoutsideofyourapp,thensendandreceivelocal

    2022年6月23日
    24
  • eric6教程(电脑的配置基本知识)

    欢迎加入QQ群:853840665,一块学习讨论单击菜单栏Setting->Preferences,进入设置界面 下面从上而下设置比较常用的设置,其他的各位可以自行研究1.设置编译器2.设置API3设置自动补全4.设置自动检查时间间隔默认是5S,我在用的时候发现经常代码该正确了,却还是提示错误,这里把时间改短5.设置字体大小…

    2022年4月15日
    41
  • 1.插槽slot基本使用「建议收藏」

    1.插槽slot基本使用「建议收藏」<body><divid="app"><cpn></cpn><cpn><bstyle="c

    2022年8月1日
    6
  • openssl安装教程(openssl windows)

    安装步骤,首先解压安装文件openssl-1.0.0d.tar,然后进入目录执行config命令./config–prefix=/home/alipms/lib/openssl (64位操作系统:./config–prefix=/home/alipms/lib/openssl  enable-shared)makemakeinstall在执行makeinstal…

    2022年4月15日
    314

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号