内连接:join ...on/inner join...on
1 join on 和 inner join on是等同的。属于
SELECT *FROM lambda.sys_user JOIN lambda.sms_send_log ON sys_user.`id`=sms_send_log.id
意味者:id相同,字段叠加
![](https://img-blog.csdn.net/20170919085430317?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTGluamluZ2ppYVZTSVQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![](https://img-blog.csdn.net/20170919085506206?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTGluamluZ2ppYVZTSVQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
表的字段太多了,截取图1与图2 ,很明显,id相同,字段叠加
外连接:Full outer join、left join ....on /left outer join ...on、right join...on/right outer join...on
left join...on:left join...on:是以两个表的内连接为基础,没有进行填充
![](https://img-blog.csdn.net/20170919090435430?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTGluamluZ2ppYVZTSVQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![](https://img-blog.csdn.net/20170919090457095?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTGluamluZ2ppYVZTSVQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
right join...on 与左外连接类似
Mysql不支持Full outer join...on,但可以用union来连接
SELECT *FROM lambda.sys_user LEFT JOIN lambda.sys_url ON sys_user.`id`=sys_url.id UNION SELECT *FROM lambda.sys_user RIGHT JOIN lambda.sys_url ON sys_user.`id`=sys_url.id