(转载)在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 索引特 ...
随机推荐
- C# 中使用win32函数 GetScrollInfo返回false 返回引用全是零的问题
最近做一个项目要获得ScrollBar的位置,因为.net找不到此类功能,只好用MFC中的函数了,GetScrollPos只返回listview顶部的位置,此时我找到了GetScrollInfo,觉得 ...
- SQL的定义与使用
一.SQL的定义 SQL(structured query language)即结构化查询语句,是关系数据库的标准语言. SQL的特点有: 1.综合统一 SQL集数据定义语言DDL.数据操作语言DML ...
- bzoj1901:Zju2112 Dynamic Rankings
思路:树套树,我写了两种,一种是线段树套splay,线段树维护区间信息,splay维护第k大,一种是树状数组套权值线段树(并不是什么可持久化线段树,只不过是动态开点罢了,为什么网上一大堆题解都是可持久 ...
- Cassandra CqlRow fetch DateType / Int32Type
phpcassa library里有个namespace : use phpcassa\Schema\DataType; 当使用cql query得到cqlrow, int32 & Date ...
- python相关博客
入门:http://www.pythontip.com/ Python之禅--大道至简 美胜于丑,显胜于隐,简胜于繁,繁胜于杂,平胜于迭,疏胜于密,读胜于写...名可名, 请常名 http://www ...
- float right 换行bug
Bug产生原因:块里面有换行的元素. CSS: .left{float: left;width: 100px;background: #fff000;} .right{float: right;wid ...
- 解析sql中的表名
最近的项目需求中需要解析sql得表名,由于只需要表名我觉得应该用相对粗暴一点的方式来解析 初步思路: 1.转义字符:去除两个引号连在一起的 2.字符串: 去除所有被引号包裹的 3.括号:识别括号处理 ...
- 在后台代码中引入XAML的方法
本文将介绍三种方法用于在后台代码中动态加载XAML,其中有两种方法是加载已存在的XAML文件,一种方法是将包含XAML代码的字符串转换为WPF的对象. 一.在资源字典中载入项目内嵌资源中的XAML文件 ...
- WCF Rest Json
1.定义ServiceContract及实现 [ServiceContract] public interface IMemberService { [OperationContract] strin ...
- C语言-06复杂数据类型-03指针
指针变量的定义 变量类型 *变量名; #include <stdio.h> int main() { // 指针就一个作用:能够根据一个地址值,访问对应的存储空间 // 指针变量p前面的i ...