两种作用,第一个作用相当于左连接,第二个作用是过滤 p表的记录再进行关联。
例如:
select p.fdept_id, decode(p.fis_allow_edit, 'Y', '0', null) ftalbe_desc, t.* from hthis.p_cp_table t, hthis.PSTDEPTCP p where t.ftable_id = p.ftable_id(+) and p.fdept_id(+) = '9999';
相当于:
select p.fdept_id, decode(p.fis_allow_edit, 'Y', '0', null) ftalbe_desc, t.* from hthis.p_cp_table t, (select * from hthis.PSTDEPTCP where fdept_id = '9999') p where t.ftable_id = p.ftable_id(+);
扩展资料
连接分为左外连接,右外连接,全外连接。对应SQL:LEFT/RIGHT/FULL OUTER JOIN。
outer join则会返回每个满足第一个(顶端)输入与第二个(底端)输入的联接的行。它还返回任何在第二个输入中没有匹配行的第一个输入中的行。
在左外连接和右外连接时都会以一张表为基表,该表的内容会全部显示,然后加上两张表匹配的内容。如果基表的数据在另一张表没有记录。那么在相关联的结果集行中列显示为空值(NULL)。
参考资料来源:百度百科-外连接