mysql 7 种 join

Posted 方方方方方方

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 7 种 join相关的知识,希望对你有一定的参考价值。

一、

select * from A inner join B on A.key = B.key

二、

select * from A left join B on A.key = B.key

三、

select * from A right join B on A.key = B.key

四、

select * from A left join B on A.key = B.key where b.key is null

五、

select * from A right join B on A.key = B.key where A.key is null

六、

select * from A left join B on A.key = B.key
union
select * from A right join B on A.key = B.key

七、

select * from A left join B on A.key = B.key where B.key is null
union
select * from A right join B on A.key = B.key where A.key is null

 

以上是关于mysql 7 种 join的主要内容,如果未能解决你的问题,请参考以下文章

mysql 7 种 join

mysql 7种JOIN理论,看完你就懂了

mysql 7种JOIN理论,看完你就懂了

MySQL--7种join连接

SQL 的 7 种 JOIN

MYSQL06_sql99的7种JOIN操作union all