本文按MySQL必知必会的架构组织
内连接又叫等值连接
使用where关键字连接 同时可以使用inner join tableA, tableB on tableA.word = tableB.word
自连接
表自身进行连接
select p1.id, p1.name from products as p1, products as p2
where p1.id = p2.id and p2.id = ''xxx"
自然连接
不是某个关键字,而是在选多个表的列的时候自己的操作,使得多个表的同名列只出现一次。一般情况下,我们使用的都是符合自然连接的内连接
外部连接
包括在相关表中没有关联行的行
left outer join / right outer join