(转载)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. linq 多条件查询 where 拼接+分页

    首先定义一个静态类 public static class QueryAssembly { /// <summary> /// 返回true /// </summary> // ...

  2. Mac OS X 配置环境变量

    /etc/profile:/etc/bashrc 是针对系统所有用户的全局变量,只有root用户才能修改这两个文件,对一般用户来说是他们是只读的.一般用户要想修改它们,可以在命令前加sudo,意思是以 ...

  3. hpple 简单使用

    最近项目使用到hpple,简单说一下使用方式,做做笔记 let responseData = response as! NSData let utf8Html = responseData.strin ...

  4. 03_天气查询_socket方式模拟_多线程方式

    [简述] 要重视Socket开发,企业后台服务特长使用Socket. 1.服务端要有可持续运行能力,保证线程一致在运行 2.并发处理能力,使用多线程 [工程截图] [WeatherRunner.jav ...

  5. SETLOCAL

    Quote from: http://ss64.com/nt/setlocal.html SETLOCAL Set options to control the visibility of envir ...

  6. 九度OJ 1352 和为S的两个数字

    题目地址:http://ac.jobdu.com/problem.php?pid=1352 题目描述: 输入一个递增排序的数组和一个数字S,在数组中查找两个数,是的他们的和正好是S,如果有多对数字的和 ...

  7. ISO 学习笔记 2015-03-15

    Objective--C 一 关键字 @property 定义变量函数 @synthesize 实现变量函数 二 函数 alloc 分配内存 init 初始化 new 替代上面两个函数 分配内存,并且 ...

  8. AJAX 简单上手

    AJAX简介 没有AJAX会怎么样?普通的ASP.Net每次执行服务端方法的时候都要刷新当前页面,如实现显示服务器的时间每次都要刷新页面的坏处:页面刷新打断用户操作.速度慢.增加服务器的流量压力.如果 ...

  9. jQuery移除指定元素后的所有元素

    jQuery 遍历的nextAll() 方法可以搜索 DOM 树中的元素跟随的同胞元素,也就是一个元素后面的所有同级元素,删除可以使用方法remove(),所以连起来为 $(selector).nex ...

  10. PHP保存base64

    base64图片格式:$base64_url = data:image/jpeg;base64,xxxxxxxxxxxxxxxxxxxxxx 1,去除头部:$base64_body = substr( ...