7种join连接查询

内链接--取共有部分
select <select_list>
from tableA a
inner join tableB b
on a.key =b.key
 
 
 ab共有加a的独有(全a)--左链接
select<select_list>
from tableA a
left join tableB b
on a.key=b.key 
 
b独有+ab共有(全b)
 
select<select_list>
from tableA a
right join tableB b
on a.key=b.key
 
select<select_list>
frin tableA a
left join tableB b
on a.key =b.key
where b.key is null
 
select<select_list>
from tableA a
right join tableB b
on a.key=b.key
where a.key is null
 

 

 

select<select_list>
from tableA a
full outer join tableB b
on a.key=b.key
 
 
select<select_list>
from tableA a
full outer join tableB b
on a.key=b.key
where a.key is null
or b.key is null
 
 
 
 
 
 
posted @ 2022-05-19 23:31  三号小玩家  阅读(245)  评论(0)    收藏  举报
Title
三号小玩家的 Mail: 17612457115@163.com, 联系QQ: 1359720840 微信: QQ1359720840