MySQL七种join理论
作者:互联网
1. 内连接
x
English
TRANSLATE with
COPY THE URL BELOW
Back
EMBED THE SNIPPET BELOW IN YOUR SITE
Enable collaborative features and customize widget: Bing Webmaster Portal
Back
select * from A inner join B where A.key=B.key;
2. 左连接
select * from A left join B on A.key=B.key where B.key is null;
3. 右连接
select * from A right join B on A.key=B.key where A.key is null;
4. 左外连接
select * from A left join B on A.key=B.key;
5. 右外连接
select * from A right join B on A.key=B.key
6. 全外连接
select * from A left join B where A.key=B.key union select * from A right join B where A.key=B.key;
7. 两表独有的数据集
select * from A left join B on A.key=B.key where B.key is nullTRANSLATE with
union
select * from A right join B on A.key=B.key where A.key is null;
标签:right,join,七种,key,MySQL,null,where,select 来源: https://www.cnblogs.com/mylpy/p/15360779.html