错误:Column 'Id' in field list is ambiguous

SELECT `渠道名称` , SUM(`当日其他`) AS 当月其他
FROM `渠道信息` as A , `一线数据汇总` AS B
WHERE A.`渠道名称` = B.`渠道名称`
GROUP BY `渠道名称`

  错误原因:表A和表B里都有‘渠道名称‘,select时要指明是哪个表里的。

SELECT A.`渠道名称` , SUM(`当日其他`) AS 当月其他
FROM `渠道信息` as A , `一线数据汇总` AS B
WHERE A.`渠道名称` = B.`渠道名称`
GROUP BY `渠道名称`

  OK

可以先写from,再写select什么。

错误:Column 'Id' in field list is ambiguous

原文地址:https://www.cnblogs.com/soberkkk/p/12529912.html

时间: 2024-08-10 05:35:41

错误:Column 'Id' in field list is ambiguous的相关文章

转 column 'id' in field list is ambiguous的问题

column 'id' in field list is ambiguous 这个错误,是因为你查询语句里面有id字段的时候,没有说明是哪个表的id字段,应该加上表名(或者别名)来区分. 用表名进行区分的例子: select student.id, student.name, score.total from student, score where student.id = score.id 使用别名的例子: 用表名进行区分的例子: select s.id, s.name, c.total f

column 'id' in field list is ambiguous

column 'id' in field list is ambiguous 这个错误,是因为你查询语句里面有id字段的时候,没有说明是哪个表的id字段,应该加上表名(或者别名)来区分. 用表名进行区分的例子:select student.id, student.name, score.totalfrom student, scorewhere student.id = score.id 使用别名的例子:用表名进行区分的例子:select s.id, s.name, c.totalfrom st

错误代码 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 执行

Column 'username' in field list is ambiguous、邮件漏发等问题的分析及解决

问题1.Column 'username' in field list is ambiguous ### The error may involve com.fx.oa.module.per.leave.api.shared.domain.PositiveEntity.queryListForPage-Inline ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions.jdbc4.

Column 'id' in where clause is ambiguous

1.错误描述 org.hibernate.exception.ConstraintViolationException: error executing work at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:72) at org.hibernate.exception.internal.StandardSQLExceptionConverter

错误代码: 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 执行

【MySQL 线上 BUG 分析】之 多表同字段异常:Column ‘xxx’ in field list is ambiguous

一.生产出错! 今天早上11点左右,我在工作休息之余,撸了一下猫.突然,工作群响了,老大在里面说:APP出错了! 妈啊,这太吓人了,因为只是说了出错,但是没说错误的信息.所以我赶紧到APP上看看. 这果然是出错了,而且还是简单而粗暴的500,太吓人了. 二.本地赶紧调试起来! 既然线上出错了,我们又不能直接进行调试,那当然得马上在本地搞起来了! 1.代码是否有错? 立马启动本地的项目,访问对应的接口,看看是不是代码哪里出错了. 好了,本地的代码和 SQL 都是没错的! 2.SQL 是否有错? 那

discuzX3.2错误 (1054) Unknown column 'conuintoken' in 'field list'

开启QQ互联后,点击登录以后报错:(1054) Unknown column 'conuintoken' in 'field list'   下面把解决方法分享一下: 输入以下句子运行:(其中的 pre_ 为你论坛数据库的表前缀,如果不是默认的,请注意修改) ALTER TABLE  `pre_common_member_connect` ADD COLUMN conuintoken char(32) NOT NULL DEFAULT '';ALTER TABLE  `pre_common_co

Unknown column 'user_uid' in 'field list' sql错误解决过程

在idea中运行一直有错,找了好多个地方都找不到,以为是我的字段名字写错了,然而都是对的. 把错误的这个字段删了再打一遍就好了, Unknown column 'user_uid' in 'field list' sql错误解决过程 原文地址:https://www.cnblogs.com/zxrxzw/p/10630164.html