MySQL 的各种 join

join 类型 备注
left [outer] join
right [outer] join
union [all | distinct] MySQL中没有 full [outer] join,用 union 代替;
distinct: 可选,删除结果集中重复的数据。默认情况下 union 操作符已经删除了重复数据,所以 distinct 修饰符对结果没啥影响;
all: 可选,返回所有结果集,包含重复数据。
join、cross join、inner join In MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents (they can replace each other). In standard SQL, they are not equivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used otherwise.(此说明出于mysql命令行:mysql> help join)(在 MySQL中,join、cross join、inner join这3个是等价的)

参考:https://mp.weixin.qq.com/s?__biz=MzU4OTI3NzY4OA==&mid=2247483746&idx=1&sn=94b1a14569ff12a4776e48ee8e431ec3

原文地址:https://www.cnblogs.com/cag2050/p/11808368.html