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个是等价的) |