摘要:
(转载)http://www.cnblogs.com/zhangliyu/archive/2009/03/21/1418215.html联合查询效率较高.以下例子来说明联合查询的好处t1表结构(用户名,密码) userid int username varchar(20) password varchar(20) 1 jack jackpwd 2 owen owenpwdt3表结构(用户积分,等级) userid int jf int dj int 1 20 3 3 50 6第一:内联(inner join)如果想把用户信息,积分,等级都列出来.那么一般会这样写select * from t1 阅读全文
posted @ 2013-09-17 14:56
robotke1
阅读(167)
评论(0)
推荐(0)
摘要:
(转载)http://blog.chinaunix.net/uid-20665047-id-3137284.htmlcolumn '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, 阅读全文
posted @ 2013-09-17 14:55
robotke1
阅读(582)
评论(0)
推荐(0)