1. 程式人生 > >mysql資料庫各種join的使用結果展示

mysql資料庫各種join的使用結果展示

這裡只包含了常用的幾種;

user表:


user_1011表:

select * from user u0 left join user_1011 u1 on u1.name = u0.name;


select * from user u0 left join user_1011 u1 on u1.name = u0.name where u1.name is not null;


select * from user u0 left join user_1011 u1 on u1.name = u0.name and u1.name is not null;


select * from user u0 left join user_1011 u1 on u1.name = u0.name where u1.name is null;


select * from user u0 inner join user_1011 u1 on u1.name = u0.name;


a left join b = b right join a 

總結:


mysql不支援outer join