内链接是获取两个表的交集
sqlselect * from a join b on a.id=b.id
select * from a inner join b on a.id=b.id
--oracle中还可以实现
select * from a,b where a.id=b.id
左链接是获取两个表的交集,以及左边表所有的内容,不满足的记录会用null字段表示
sqlselect * from a left join b on a.id=b.id
select * from a left outer join b on a.id=b.id
--oracle中还可以实现
select * from a,b where a.id(+)=b.id
右链接是获取两个表的交集,以及右边表所有的内容,不满足的记录会用null字段表示
sqlselect * from a right join b on a.id=b.id
select * from a right outer join b on a.id=b.id
--oracle中还可以实现
select * from a,b where a.id=b.id(+)
全链接是获取两个表所有的记录
sqlselect * from a full join b on a.id=b.id
select * from a full outer join b on a.id=b.id
--oracle中还可以实现
select * from a,b where a.id(+)=b.id(+)
本文作者:Weee
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
预览: