1.左外连接
select * from t_a a left join t_b b on a.id=b.id;
select * from t_a a,t_b b where a.id=b.id(+);

外连接与内连接

2.右外连接
select * from t_a a right join t_b b on a.id = b.id;
select * from t_a a,t_b b where a.id(+)=b.id;

外连接与内连接

3.完全外连接
select * from t_a a full join t_b b on a.id=b.id;

外连接与内连接

4.等值连接(我们在看看等值连接的结果)
select * from t_a a,t_b b where a.id=b.id;
select * from t_a a join t_b b on a.id=b.id;--等值连接也可以这样写

外连接与内连接

注意:以前理解等值连接和完全外连接是一回事,现在看来是我理解错了。等值连接是只把满足条件的两个表的行相连,然后显示出来。完全外连接是把匹配查询条件的行、左表没有匹配到的、右表没有匹配到的都显示出来。

相关文章:

  • 2021-12-17
  • 2021-09-10
  • 2022-12-23
  • 2021-08-27
  • 2021-12-17
  • 2021-07-04
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2021-05-17
  • 2021-10-16
  • 2022-12-23
  • 2022-02-08
相关资源
相似解决方案