MySQL七种join理论
1. 内连接
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 null
union
select * from A right join B on A.key=B.key where A.key is null;