版权声明:本文为CSDN博主「Megustas_JJC」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Megustas_JJC/article/details/86092980
对于各种join情况的总结图:
例如有如下关系的数据:
1、inner join
select * from Table_a
join Table_b on Table_a.id_a = Table_b.id_b
2.1、full outer join等于full join
select * from Table_a
full join Table_b
on Table_a.id_a = Table_b.id_b
2.2、full outer join but a.Key is null or b.Key is null
select * from Table_a
full outer join Table_b
on Table_a.id_a = Table_b.id_b
where Table_a.id_a is null or Table_b.id_b is null
3.1、left outer join等于left join
select * from Table_a
left join Table_b on Table_a.id_a = Table_b.id_b
3.2、left outer join but b.Key is null
select * from Table_a
left outer join Table_b on Table_a.id_a = Table_b.id_b
where Table_b.id_b is null
笛卡尔积
select * from Table_a ,Table_b
————————————————
版权声明:本文为CSDN博主「Megustas_JJC」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Megustas_JJC/article/details/86092980