连接类型
内连接inner join
左外连接 left outer join
右外连接 right outer join
在mysql里 join、cross join、inner join是等价的
实际开发里,喜欢使用inner join
连接条件
一般使用on关键字来设置连接条件,但也可以使用where来代替
通常是使用on关键字来设定连接的条件,使用where关键字进行结果集记录的过滤
内连接(使用较多)
显示左表以及右表符合条件的部分,公共的部分,也就是取交集
左外连接
显示左表的全部和右表中符合条件的部分
右外连接
显示右表中的全部记录和左表中符合连接条件的部分


网友评论