讲在前面,正在学习mysql,试图做一些笔记归纳,欢迎大家来一起讨论
一、mysql join关系
- inner join
select <list> from table A inner join table B on A.key=B.key;
- left outer join
select <list> from table A left join table B on A.key=B.key;
- right outer join
select <list> from table A right join table B on A.key=B.key;
- left join
select <list> from table A left join table B on A.key=B.key where B.key=null;
- right join
select <list> from table A right join table B on A.key=B.key where A.key=null;
- full join
select <list> from table A left join table B on A.key=B.key
union
select <list> from table A right join table B on A.key=B.key;
- 无交集
select <list> from table A left join table B on A.key=B.key where B.key=null
union
select <list> from table A right join table B on A.key=B.key where A.key=null;