错误代码: 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_student_info t WHERE t_student_info.stu_id = t.stu_id) stu_name from t_student_info t, t_... 错误代码: 1052 Column 'stu_id' in field list is ambiguous 执行耗时 : 0 sec 传送时间 : 0 sec 总耗时 : 0 sec
2、错误原因
SELECT
stu_id,
(SELECT
stu_name
FROM
t_student_info t
WHERE t_student_info.stu_id = t.stu_id) stu_name
FROM
t_student_info t,
t_score_info t0
WHERE t.`stu_id` = t0.`stu_id`
无法区别stu_id是属于哪张表,导致模糊不清
3、解决办法
SELECT t0.stu_id, (SELECT t.stu_name FROM t_student_info t WHERE t.stu_id = t1.stu_id) stu_name FROM t_student_info t1, t_score_info t0 WHERE t1.`stu_id` = t0.`stu_id`
错误代码: 1052 Column 'stu_id' in field list is ambiguous的更多相关文章
- MySql: Column 'XXXX' in field list is ambiguous 错误
[Err] 1052 - Column 'XXXX' in field list is ambiguous 例如: SELECT id, a.name, price, `describe`, scho ...
- column 'id' in field list is ambiguous
column 'id' in field list is ambiguous 这个错误,是因为你查询语句里面有id字段的时候,没有说明是哪个表的id字段,应该加上表名(或者别名)来区分.
- (转载)在mysql中,column 'id' in field list is ambiguous
(转载)http://blog.chinaunix.net/uid-20665047-id-3137284.html column 'id' in field list is ambiguous 这个 ...
- mysql错误:Column ‘id’ in field list is ambiguous的解决方法
[Err] 1052 - Column 'modify_time' in where clause is ambiguous 出错的语句: SELECT AVG(T.se)%60FROM( SELEC ...
- 【MySQL 线上 BUG 分析】之 多表同字段异常:Column ‘xxx’ in field list is ambiguous
一.生产出错! 今天早上11点左右,我在工作休息之余,撸了一下猫.突然,工作群响了,老大在里面说:APP出错了! 妈啊,这太吓人了,因为只是说了出错,但是没说错误的信息.所以我赶紧到APP上看看. 这 ...
- [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.roleI ...
- Column 'u_id' in field list is ambiguous
- Column 'xxx' in field list is ambiguous
一 其实看一下ambiguous的翻译就好了 一开始我觉得是含糊什么的,后来找了下才知道应该是双关... 二 所以翻译过来就是 : 列'XX'在字段列表中双关 其实就是两张表有相同的字段,但是使用时, ...
- coding++:MySQL-ERROR:Column 'complaint_settlement_id' in field list is ambiguous
(多表查询出现的问题)列'ID'在字段列表中重复,其实就是两张表有相同的字段,但是使用时表字段的名称前没有加表名,导致指代不明. 如 前面加上表名前缀就没问题了.
随机推荐
- 安装memcache及php的memcached模块
下载链接: http://pan.baidu.com/s/1o6MA8lG http://pan.baidu.com/s/1qWO8tMs http://pan.baidu.com/s/1c0iZu1 ...
- 弥补wxpython无背景图片缺陷
思路: 通过设置Panel的背景样式为wx.BG_STYLE_CUSTOM: self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) 绑定Panel的背景事情: sel ...
- iOS-RAC从新手开始
什么是RAC? 其实RAC就是一个简化代码的第三方库ReactiveCocoa,直接用Cocoapods添加到项目里就可以, podfile 文件添加 pod 'ReactiveCocoa',然后终端 ...
- python函数式编程之装饰器(一)
1.开放封闭原则 简单来说,就是对扩展开放,对修改封闭 在面向对象的编程方式中,经常会定义各种函数. 一个函数的使用分为定义阶段和使用阶段,一个函数定义完成以后,可能会在很多位置被调用 这意味着如果函 ...
- Mybatis异常There is no getter for property named 'XXX' in 'class com.xxx.xxx.UserAccountDTO
mybatis报错异常信息如下: 解决: 在接口中加上注解:@Param("userAccountDTO"),如图
- 12、SEO工程师指南 - 软件项目角色指南系列文章
第11章 SEO工程师 SEO工程师是一个比较新兴的职位,在实际的项目管理过程中,SEO工程师的地位相对靠后,只有在项目试运行以及运营期间才能体现出SEO工程师的作用.在项目完成之后, ...
- xBIM 多个IFC文件合并
目录 xBIM 应用与学习 (一) xBIM 应用与学习 (二) xBIM 基本的模型操作 xBIM 日志操作 XBIM 3D 墙壁案例 xBIM 格式之间转换 xBIM 使用Linq 来优化查询 x ...
- Annotation基础知识
1.Annotation介绍 Annontation是Java5开始引入的新特征.中文名称一般叫注解. Annontation像一种修饰符一样,应用于包.类型.构造方法.方法.成员变量.参数及本地变量 ...
- BZOJ 2406: 矩阵 [上下界网络流 二分答案]
2406: 矩阵 题意:自己去看吧,最小化每行每列所有元素与给定矩阵差的和的绝对值中的最大值 又带绝对值又带max不方便直接求 显然可以二分这个最大值 然后判定问题,给定矩阵每行每列的范围和每个元素的 ...
- 让SpringMVC Restful API优雅地支持多版本
好久没有更新博客,难得有空,记录一下今天写的一个小工具,供有需要的朋友参考. 在移动APP开发中,多版本接口同时存在的情况经常发生,通常接口支持多版本,有以下两种方式: 1.通过不同路径区分不同版本 ...