Oracle中内连接、外连接、右外连接、全外连接小结
来源:互联网 发布:华育杯网络作文大赛 编辑:程序博客网 时间:2024/05/14 00:01
下面有三张表:testA、testB、testC
testA
AB11A22A
testB
AB11B33B
testC
A
B
1
1C
4
4C
内连接:最常见的等值连接
例如:select * from testA,testB where testA.A=testB.B;
ABAB11A11B
外连接:分为左外连接、右外连接和全外连接
1. 左外连接:left outer join 或者 left join
左外连接就是在等值连接的基础上加上主表中的未匹配数据.
例如:select * from testA left outer join testB on testA.A = testB.A;
或者 select * from testA ,testB where testA.A = testB.A(+);
ABAB11A11B22A
三张表的左外连接:
select * from testA
left outer join testB on testA.A = testB.A
left outer join testC on testA.A = testC.A;
或者
select * from testA ,testB,testC
where testA.A = testB.A(+)
and testA.A = testC.A(+);
ABABAB11A11B11C22A
2. 右外连接 right outer join或者right join
左外连接就是在等值连接的基础上加上被连接表中的不匹配数据.
例如:select * from testA right outer join testB on testA.A = testB.A;
或者 select * from testA ,testB where testA.A(+) = testB.A;
ABAB11A11B 33B
3. 全外连接 full outer join 或者 full join
全外连接是在等值连接的基础上将左表和右表的未匹配数据都加上
例如:select * from testA full outer join testB on testA.A=testB.A;
ABAB11A11B22A 33B
- Oracle中内连接、外连接、右外连接、全外连接小结
- 内连接,外连接,左连接,右连接,全连接
- oracle中emp表的内连接,左外连接,右外连接,全外连接
- oracle中emp表的内连接,左外连接,右外连接,全外连接
- oracle中emp表的内连接,左外连接,右外连接,全外连接
- 内连接,外连接,左连接,右连接,全连接,内连接,交叉连接,自连接
- 内连接,外连接,左连接,右连接,全连接,内连接,交叉连接,自连接
- 左外连接,右外连接,全连接,内连接。
- 左外连接、右外连接、内连接、全连接
- 左外连接、右外连接、内连接、全连接
- Oracle 的四种连接-左外连接、右外连接、内连接、全外连接
- Oracle 的四种连接-左外连接、右外连接、内连接、全连接
- Oracle 的四种连接-左外连接、右外连接、内连接、全连接
- SQL四中连接(左外连接、右外连接、内连接、全连接)
- 【Oracle】多表连接查询——内连接、左连接、右连接、全连接(外连接)、完全连接
- 内连接、外连接[左连接、右连接、全连接]、交叉连接、自连接
- Oracle内连接、外连接、右外连接、全外连接小总结
- Oracle内连接、外连接、右外连接、全外连接小总结
- 如何在程序员中区分二逼和天然萌?
- Apache HttpClient[转载]
- typedef和define的区别
- sql习题1(我的答案)
- Android签名和反编译的学习
- Oracle中内连接、外连接、右外连接、全外连接小结
- 成都建成世界级云计算实验基地(3万平方米,3500机架)
- Tictoc的学习重点
- 英文邮件中常见的英语缩写
- 各浏览器对小数处理取整的情况对比【IE、chrome、firefox、safari】
- 30.在从1到n的正数中1出现的次数
- Tomcat启动web项目报Bad version number in .class file (unable to load class ...)错
- 面试题数据结构-n个筛子的点数
- Android Service学习之AIDL, Parcelable和远程服务