[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 ...
随机推荐
- CSS3 基础学习
CSS基础学习 当前进度[P78] 参考资料 视频链接:https://www.bilibili.com/video/BV14J4114768 菜鸟教程:https://www.runoob.com/ ...
- Redis 17 缓存穿透 缓存击穿 缓存雪崩
参考源 https://www.bilibili.com/video/BV1S54y1R7SB?spm_id_from=333.999.0.0 版本 本文章基于 Redis 6.2.6 使用缓存的问题 ...
- 记录第一次给开源项目提 PR
本文是深入浅出 ahooks 源码系列文章的第八篇,该系列已整理成文档-地址.觉得还不错,给个 star 支持一下哈,Thanks. 本篇文章算是该系列的一个彩蛋篇,记录一下第一次给开源项目提 PR ...
- js运算符和逻辑分支
运算符 1.拼接运算符:+,加号两边只要有一边出现字符串就是拼接 2.算术运算符 如:2+3: 3.赋值运算符+=,-=,/=,*= 4.关系运算符>,<,==,=== != !== ! ...
- Java精进-20分钟学会mybatis使用
文字分享 希望现在的你无论有明确具体的目标还是没有,都能重视自己的需求和目标,并且常常回顾,或许可以找一个你习惯的方式写出来,挂在哪里,电脑或日记本都好.当你疲惫或迷茫的时候拿出来看一下,这在情怀领域 ...
- HDU6848改编题(弱化)——客星璀璨之夜(stars)
「 客星璀璨之夜 」(stars) " 虽然不清楚是不是那两人的力量 在那个风暴肆虐的夜晚,的确有一瞬 真的在那一瞬间,在云破天开的时候 透过空隙中看到的璀璨星空,不知为何倒映眼中不能忘怀 ...
- IO流----读取文件,复制文件,追加/插入文件
文件结构 读取文件 第一种方式 public class Test { public static void main(String[] args) throws IOException { // 最 ...
- Android下的Drawable使用
Drawable表示一种可绘制的内容,可以由图片或者颜色组成.Android下的Drawable有BitmapDrawable.GradientDrawable.LayerDrawable等等 1.B ...
- 【Traefik二次开发】中间件 Middleware 开发
本篇只讨论HTTP中间件 中间件定义 https://doc.traefik.io/traefik/middlewares/overview/ Attached to the routers, pie ...
- k8s驱逐篇(3)-kubelet节点压力驱逐-源码分析篇
kubelet节点压力驱逐-概述 kubelet监控集群节点的 CPU.内存.磁盘空间和文件系统的inode 等资源,根据kubelet启动参数中的驱逐策略配置,当这些资源中的一个或者多个达到特定的消 ...