MySQL多表连接操作

Posted tataerzu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL多表连接操作相关的知识,希望对你有一定的参考价值。

1 select * from userinfo ,dapartment where userinfo.part_id = dapartment.id;
2      --左连接: 左边全部显示
3      select * from userinfo left join dapartment on userinfo.part_id=dapartment.id;
4      --右连接:右边的全部显示
5      select * from userinfo right join dapartment on userinfo.part_id=dapartment.id;
6      --内连接: 将出现null的一行隐藏
7      select * from userinfo inner join dapartment on userinfo.part_id = dapartment.id;

 

以上是关于MySQL多表连接操作的主要内容,如果未能解决你的问题,请参考以下文章