(转载)在mysql中,column 'id' in field list is ambiguous
(转载)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的更多相关文章
- column 'id' in field list is ambiguous
column 'id' in field list is ambiguous 这个错误,是因为你查询语句里面有id字段的时候,没有说明是哪个表的id字段,应该加上表名(或者别名)来区分.
- MySql: Column 'XXXX' in field list is ambiguous 错误
[Err] 1052 - Column 'XXXX' in field list is ambiguous 例如: SELECT id, a.name, price, `describe`, scho ...
- 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错误:#1054 - Unknown column 'id' in 'field list' 解决办法
第一次用mysql,在插入数据时,竟然报这样的错误, #1054 - Unknown column 'id' in 'field list'
- 【MySQL 线上 BUG 分析】之 多表同字段异常:Column ‘xxx’ in field list is ambiguous
一.生产出错! 今天早上11点左右,我在工作休息之余,撸了一下猫.突然,工作群响了,老大在里面说:APP出错了! 妈啊,这太吓人了,因为只是说了出错,但是没说错误的信息.所以我赶紧到APP上看看. 这 ...
- MySQL 中 where id in (1,2,3,4,...) 的效率问题讨论
MySQL ACMAIN_CHM06-26 16:36 等级 84次回复 [求证&散分]MySQL 中 where id in (1,2,3,4,...) 的效率问题讨论 庆祝本月大版得 ...
- 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 ...
- 【转载】Mysql中的Btree与Hash索引比较
转载地址:http://www.jb51.net/article/62533.htm 这篇文章主要介绍了Mysql中的Btree与Hash索引比较,本文起讲解了B-Tree 索引特征.Hash 索引特 ...
随机推荐
- 控制器的跳转-modal与push
一.modal与pushmodal从下面往上盖住原来的控制器,一般上一个控制器和下一个控制器没有什么关联时用modal,比如联系人的加号跳转页面,任何控制器都可以用modal push一般是上下文有关 ...
- 初尝 Perl
本文将阐述以下几方面内容: 1.什么是Perl 2.Perl有什么用 3.Windows 下的Perl环境搭建 4.Perl 版Hello World 5.Perl 语法梗概 6.一些参考资料 什么是 ...
- javascript变量,类型 第9节
1.变量,数据类型 <html> <head> <title>变量</title> </head> <body> <h3& ...
- Mysql笔记【3】-SQL约束
SQL 约束 约束用于限制加入表的数据的类型. 可以在创建表时规定约束(通过 CREATE TABLE 语句),或者在表创建之后也可以(通过 ALTER TABLE 语句). 我们将主要探讨以下几种约 ...
- Codevs 1958 刺激
1958 刺激 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description saffah的一个朋友S酷爱滑雪,并且追求刺激(exitement, ...
- IOS 学习日志 2015-3-13
前面几天在看C ,但是没有做笔记,现在在看Objective--C ,开始做笔记,希望每一天都有成长吧 Objective--C 关键字 1 @import 导入 注意<>||" ...
- 入门2:PHP相关的名词解释
/**宝宝我英语不好,后面注释拼音 请见谅**/ 1.Linux 开源的操作系统,在服务器端用户数量非常大,很多服务器都是使用Linux系统运行的. 相对windows系统来说具有非常完善的用户权限系 ...
- php快递单号查询源码
贴下记录下php查询快递单号的源码,能查询各种快递的快递单号记录,中通.圆通快递.顺丰快递等都不是问题.只需要在 爱快递(www.aikuaidi.cn)上面申请一个快递key即可,下面把源码分享下, ...
- jquery插件----文件上传uploadfile
使用了一款jquery上传的插件,ajax上传,可以显示上传的进度,高可配性,简要记录. 插件地址http://hayageek.com/docs/jquery-upload-file.php git ...
- 禁止生产pyc
sys.dont_write_bytecode = 1 来自为知笔记(Wiz)