[Err] 1052 - Column ‘roleId‘ in where clause is ambiguous
1、先看错误的sql语句:
select a.authName from roles as r,authority as a,role_ah as ra where ra.roleId=r.roleId and ra.ahId=a.ahId and roleId='R002'
2、再看正确的sql语句:
select a.authName from roles as r,authority as a,role_ah as ra where ra.roleId=r.roleId and ra.ahId=a.ahId and r.roleId='R002'
[Err] 1052 - Column ‘roleId’ in where clause is ambiguous
这句话的意思是:[Err]1052-where子句中的“roleId”列不明确
多个表中都有相同的属性列(我这里是角色表、权限表、角色权限联合表。角色权限联合表中包含着角色表和权限表中的主键)。在查询时,没有指定哪个表的属性列。
总结:当遇到多表查询、并且查询条件的属性列存在多个表时、需要显示定义具体表的属性列。
[Err] 1052 - Column ‘roleId‘ in where clause is ambiguous的更多相关文章
- Column 'id' in where clause is ambiguous
1.错误描述 org.hibernate.exception.ConstraintViolationException: error executing work at org.hibernate.e ...
- 错误代码: 1052 Column 'stu_id' in field list is ambiguous
1.错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:select stu_id, (SELECT stu_name FROM t ...
- java mybatis Column 'AAA' in where clause is ambiguous
今天在java mybatis项目中遇到一个问题,“java mybatis Column 'AAA' in where clause is ambiguous”, 这是由于在多表连接查询的时候,遇上 ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'org_mer_id' in where clause is ambiguous
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolatio ...
- SQL语句之Column 'Status' in where clause is ambiguous错误
问题: AND created_by IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) limit 0, 10]; Column 'created_by' in where cla ...
- Column ‘name’ in where clause is ambiguous;
内容 一.异常信息 严重: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw except ...
- Java开发问题:Column 'AAA' in where clause is ambiguous解决办法
当在java开发中遇到了Column 'AAA' in where clause is ambiguous问题时, 你需要去看看:多表查询的时候不同的表是否出现了相同名称相同的列, 如果存在,你需要在 ...
- Column 'orders' in order clause is ambiguous
今天报了这个错误 原因是.当使用sql查询语句,使用了join查表.但是这个orders没指定是哪张表的字段 ,发生在自关联情况
- mysql错误:Column ‘id’ in field list is ambiguous的解决方法
[Err] 1052 - Column 'modify_time' in where clause is ambiguous 出错的语句: SELECT AVG(T.se)%60FROM( SELEC ...
随机推荐
- react学习1-jsx语法注意点
* 1.定义虚拟DOM不要写引号 * 2.标签中使用js表达式的时候,要使用{} * 3.样式类名指定要使用className * 4.要使用内联样式的话,要使用style={{key:"v ...
- DolphinScheduler 在绿瘦的实践成果,开启了我的开源之路!
点击上方 蓝字关注我们 ✎ 编 者 按 2021 年,Apache DolphinScheduler 社区又迎来了新的蓬勃发展,社区活跃度持续提高.目前,项目 GitHub Star 已达 6.7k, ...
- DolphinScheduler 荣获 2021 中国开源云联盟优秀开源项目奖!
点击上方 蓝字关注我们 好消息,中国开源云联盟(China Open Source Cloud League,简称"COSCL")于近日公布 2021 杰出开源贡献者.优秀开源项目 ...
- 我和Apache DolphinScheduler的缘分
关于 DolphinScheduler社区 Apache DolphinScheduler(incubator) 于17年在易观数科立项,19年3月开源, 19 年8月进入Apache 孵化器,社区发 ...
- 【沥血整理】灰度(二值)图像重构算法及其应用(morphological reconstruction)。
不记得是怎么接触并最终研究这个课题的了,认识我的人都知道我是没有固定的研究对象的,一切看运气和当时的兴趣.本来研究完了就放在那里了,一直比较懒的去做总结,但是想一想似乎在网络上就没有看到关于这个方面的 ...
- SvelteUI:运用svelte3构建的网页版UI组件库(升级版)
距离上次分享的svelte-ui 1.0已经一月有余,这次带来全新升级完整版svelte-ui 2.0. 这次优化并新增15+个组件.在开发之初借鉴了element-ui组件库,所以在组件结构及语法上 ...
- React报错之React Hook 'useEffect' is called in function
正文从这开始~ 总览 为了解决错误"React Hook 'useEffect' is called in function that is neither a React function ...
- mybatisplus-sql注入器
sql注入器 使用mybatisplus只需要继承BaseMapper接口即可使用:但是有新的需求需要扩展BaseMapper里面的功能时可使用sql注入器. 扩展BaseMapper里面的功能 点击 ...
- 持久化-DLL劫持
持久化-DLL劫持 原理 通过篡改.替换和代理原dll文件来达到劫持. 原理演示 假定演练流程 假定我们要劫持的目标是 c:\temp\legit.dll 获取 c:\temp\legit.dll 所 ...
- Tomcat入门学习笔记
Tomcat服务器 Tomcat使用 Tomcat下载 官网地址:Apache Tomcat - Apache Tomcat 8 Software Downloads 下载Windows 64位版To ...