1. 程式人生 > >MySQL多表連線操作

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;