(转载)http://blog.chinaunix.net/uid-20665047-id-3137284.html

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
from student s, score c
where s.id =
c.id

许多教材都大量使用别名,其实对于初学者,我建议大家看得懂别名就行,自己写的时候用表名好

(转载)在mysql中,column 'id' in field list is ambiguous的更多相关文章

  1. column 'id' in field list is ambiguous

    column 'id' in field list is ambiguous  这个错误,是因为你查询语句里面有id字段的时候,没有说明是哪个表的id字段,应该加上表名(或者别名)来区分.

  2. MySql: Column 'XXXX' in field list is ambiguous 错误

    [Err] 1052 - Column 'XXXX' in field list is ambiguous 例如: SELECT id, a.name, price, `describe`, scho ...

  3. mysql错误:Column ‘id’ in field list is ambiguous的解决方法

    [Err] 1052 - Column 'modify_time' in where clause is ambiguous 出错的语句: SELECT AVG(T.se)%60FROM( SELEC ...

  4. Mysql错误:#1054 - Unknown column 'id' in 'field list' 解决办法

    第一次用mysql,在插入数据时,竟然报这样的错误, #1054 - Unknown column 'id' in 'field list'

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

    一.生产出错! 今天早上11点左右,我在工作休息之余,撸了一下猫.突然,工作群响了,老大在里面说:APP出错了! 妈啊,这太吓人了,因为只是说了出错,但是没说错误的信息.所以我赶紧到APP上看看. 这 ...

  6. MySQL 中 where id in (1,2,3,4,...) 的效率问题讨论

     MySQL ACMAIN_CHM06-26 16:36 等级 84次回复 [求证&散分]MySQL 中 where id in (1,2,3,4,...) 的效率问题讨论 庆祝本月大版得 ...

  7. Column 'id' in where clause is ambiguous

    1.错误描述 org.hibernate.exception.ConstraintViolationException: error executing work at org.hibernate.e ...

  8. 错误代码: 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 ...

  9. 【转载】Mysql中的Btree与Hash索引比较

    转载地址:http://www.jb51.net/article/62533.htm 这篇文章主要介绍了Mysql中的Btree与Hash索引比较,本文起讲解了B-Tree 索引特征.Hash 索引特 ...

随机推荐

  1. 一、VSTO概述

    一.什么是VSTO? VSTO = Visual Studo Tools for Office,是.net平台下的Office开发技术.相对于传统的VBA(Visual Basic Applicati ...

  2. 输出图像到文件 imwrite()[OpenCV 笔记7]

    bool imwrite(const string& filename, InputArray img, const vector<int>& params=vector& ...

  3. C++类继承内存布局(三)

    参考:http://blog.csdn.net/jiangyi711/article/details/4890889# (三)成员函数 类X中每一个非静态成员函数都会接受一个特殊的隐藏参数——this ...

  4. 九度OJ 1042 Coincidence -- 动态规划(最长公共子序列)

    题目地址:http://ac.jobdu.com/problem.php?pid=1042 题目描述: Find a longest common subsequence of two strings ...

  5. log4j使用细节

    问题一:打印不同类的类名信息? 在log4j中通常是通过Logger.getLogger(class)指定所打印的类名,但是当我们需要打印不同类信息时,目前只能这样做,在不同的类文件中构建不同的log ...

  6. c#根据文件大小显示文件复制进度条实例

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. absolute独立使用之下拉框最佳实践

              说明:传统的做法是给外部盒子relative定位,再给弹出框absolute定位,而这里我们将absolute独立使用 html <div class="searc ...

  8. 测试php页面执行代码时间

    //生命一个计算脚本运行时间的类 class Timer { private $startTime = 0; //保存脚本开始执行时的时间(以微秒的形式保存) private $stopTime = ...

  9. 犯这个错误的肯定不止我一个 关于File

    File.Create(string filePath)这种用法所有人都知道,这两天用到的时候却发现一个问题. 需要先判断文件是否存在,如果不存在则创建文件,然后向该文件写入数据,后续定时Append ...

  10. GitHub使用教程for Eclipse

    1.下载egit插件http://www.eclipse.org/egit/ http://www.eclipse.org/egit/download/ Installing the Latest R ...