left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录
right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录
inner join(等值连接) 只返回两个表中联结字段相等的行
现有两张表 Table_1,Table_2
3条sql语句分别为:
select * from Table_1 left join Table_2 on Table_1.name = Table_2.name select * from Table_1 right join Table_2 on Table_1.name = Table_2.name select * from Table_1 inner join Table_2 on Table_1.name = Table_2.name
结果如下: