oracle中left join,right join,inner join用法
2014-08-09 11:15
253 查看
一、oracle中left join和right join的区别
通俗的讲:A left join
B 的连接的记录数与A表的记录数同
A right join
B 的连接的记录数与B表的记录数同
A left join
B 等价B right join A
二、内连接
1.概念:内联接是用比较运算符比较要联接列的值的联接
2.内连接:join 或 inner join
3.sql语句
select * from table1 join table2 on table1.id=table2.id
4.等价
a:select a.*,b.* from table1 a,table2 b where a.id=b.id
b:select * from table1 cross join table2 where table1.id=table2.id (注:cross join后加条件只能用where,不能用on)
三、交叉连接(完全)
1.概念:没有 where 子句的交叉联接将产生联接所涉及的表的笛卡尔积。第一个表的行数乘以第二个表的行数等于笛卡尔积结果集的大小。2.交叉连接:cross join (不带条件where...)
3.sql语句
select * from table1 cross join table2
注释:返回3*3=9条记录,即笛卡尔积
4.等价
a:select * from table1,table2
相关文章推荐
- 详细解析oracle中left join,right join,inner join用法
- 详细解析oracle中left join,right join,inner join用法
- 详细解析oracle中left join,right join,inner join用法
- oracle中各种连接(left join,right join,inner join)用法
- 详细解析oracle中left join,right join,inner join用法
- 详细解析oracle中left join,right join,inner join用法-技术交流
- mysql left join,right join,inner join用法分析
- 数据库表的连接(Left join , Right Join, Inner Join)用法详解
- sql中left join(left outer join)、inner join的使用,right join(right outer join)的用法和left join的相反就可以了。
- 数据库表的连接(Left join , Right Join, Inner Join)用法详解
- 数据库表的连接(Left join , Right Join, Inner Join)用法详解 - XIAWAYUYADANG的专栏 - CSDN博客
- LEFT JOIN、RIGHT JOIN、FULL JOIN、INNER JOIN的区别以及用法
- inner join,left join,right join,full join以及外连接"(+)"的用法
- SQL语句中Left join,right join,inner join用法
- sql:inner join,left join,right join,full join的用法及含义
- Oracle inner join、left join、right join的联接查询
- oracle中left join和right join和inner join的区别
- inner join,left join,right join 三者的用法
- mysql中left join,right join,inner join,outer join的用法详解【转】
- oracle中 left join,right join, inner join,full join的简单使用