Oracle中sql语句(+)符号代表连接的使用讲解 |
oracle中sql语句(+)符号代表连接 (+)在=前边为右连接 (+)在=后边为左连接
内连接
外连接 左连接
右连接
全连接
例子: ------------------------------------------------- a表 id name b表 id job parent_id 1 张3 1 23 1 2 李四 2 34 2 3 王武 3 34 4 a.id同parent_id 存在关系 -------------------------------------------------- 内连接 select a.*,b.* from a inner join b on a.id=b.parent_id 1 张3 1 23 1 2 李四 2 34 2 左连接 select a.*,b.* from a left join b on a.id=b.parent_id 1 张3 1 23 1 2 李四 2 34 2 3 王武 null 右连接 select a.*,b.* from a right join b on a.id=b.parent_id 1 张3 1 23 1 2 李四 2 34 2 null 3 34 4 全连接 select a.*,b.* from a full join b on a.id=b.parent_id 1 张3 1 23 1 2 李四 2 34 2 null 3 34 4 3 王武 null 总结 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对脚本之家的支持 。如果你想了解更多相关内容请查看下面相关链接 您可能感兴趣的文章:
|