oracle表的连接,oracle表连接

create table a(

aid number,

aname varchar2(20)

);

create table b(

bid number,

bname varchar2(20)

);

create table c(

cid number,

cname varchar2(20)

);

insert into a(aid,aname)

SELECT 1,‘a1‘ FROM dual

union all

SELECT 2,‘a2‘ FROM dual;

insert into b

SELECT 1,‘b1‘ FROM dual;

insert into c

SELECT 2,‘c2‘ FROM dual

union all

SELECT 1,‘c1‘ FROM dual;

commit;

1、SELECT * FROM a left join b on a.aid=b.bid left join c on c.cid= a.aid;

结果:

20180416102758100320.png

2、SELECT * FROM a left join b on a.aid=b.bid left join c on c.cid= b.bid;

20180416102758818094.png

3、SELECT * FROM a left join b on a.aid=b.bid right join c on c.cid= b.bid;

20180416102758841531.png

4、SELECT * FROM a inner join b on a.aid=b.bid right join c on c.cid= b.bid;

20180416102758857156.png

5、SELECT * FROM a inner join b on a.aid=b.bid left join c on c.cid= b.bid;

20180416102759251687.png

6、SELECT * FROM a cross join c

20180416102759304422.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值