左连接,结果大于左面的表验证 解释

左连接,结果大于左面的表验证 解释

create table Employees (
       last_name varchar2(10),
       department_id varchar2(10)
);
create table Department(
       department_id varchar2(10),
       department_name varchar2(10)
);
insert into Employees values ('tom','1');
insert into Employees values ('peter','2');
insert into Employees values ('alice','3');
insert into Employees values ('jenny','5');
insert into Employees values ('linda','7');
commit;

insert into Department values ('1','baidu');
insert into Department values ('2','tensun');
insert into Department values ('3','BTC');
insert into Department values ('4','EOS');
insert into Department values ('5','HSR');
insert into Department values ('6','OMG');
insert into Department values ('7','ETH');
commit;
select * from Employees;
select * from Department  ;

/*
左连接验证(左边一共5条数据,查出来大于左边的5条,怎么解释,)
*/

select e.last_name, e.department_id, d.department_name
  from Employees e
  left outer join Department d on e.department_id = d.department_id;

LAST_NAME DEPARTMENT_ID    
1 tom 1
2 peter 2
3 alice 3
4 jenny 5
5 linda 7

 

DEPARTMENT_ID DEPARTMENT_NAME
1 1 baidu
2 2 tensun
3 3 BTC
4 4 EOS
5 5 HSR
6 6 OMG
7 1 woniupp

 

 

LAST_NAME DEPARTMENT_ID DEPARTMENT_NAME
1 1 baidu
2 peter 2 tensun
3 alice 3 BTC
4 jenny 5 HSR
5 tom 1 woniupp
6 linda 7

 

 

 

posted @ 2018-02-05 10:48 酸奶加绿茶 阅读( ...) 评论( ...) 编辑 收藏
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值