2016年3月21日

摘要: Union因为要进行重复值扫描,所以效率低。如果合并没有刻意要删除重复行,那么就使用Union All 两个要联合的SQL语句 字段个数必须一样,而且字段类型要“相容”(一致); 如果我们需要将两个select语句的结果作为一个整体显示出来,我们就需要用到union或者union all关键字。un 阅读全文
posted @ 2016-03-21 15:56 867511789 阅读(737) 评论(0) 推荐(0) 编辑
摘要: inner join 是内连接,where 是条件判断语句,用where语句可以实现内连接的功能,但区别在于where 语句还可以加上其他条件,而inner join则不可以了。例如:select a.*,b.* from a inner join b on a.id = b.id等同于select 阅读全文
posted @ 2016-03-21 15:47 867511789 阅读(3113) 评论(0) 推荐(0) 编辑

导航