The usage of (+) in Oracle

(+) is a join.
For example
, SELECT a.*, b.* from a(+) = b is a right join, which is equivalent to select a.*, b.* from a right join b
SELECT a.*, b.* from a = b(+) is a left join, which is equivalent to select a.*, b.* from a left join b
, that is, the other side of the "(+)" location is the direction of the connection, usually the full set and the partial set are combined. When connecting, put (+) behind the columns of the partial set, so that when there is no match, it also shows a null effect



select *from a,b where a.id=b.id(+) and b.name (+)='hello' b.name
is equivalent to
select * from a
   left join b
    on a.id = b.id
   and b.name = 'hello'
        ;

and
select *from a,b where a.id=b. id(+) and b.name='hello' b.name
is equivalent to
select * from a
   left join b
    on a.id = b.id
where b.name = 'hello'



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326441325&siteId=291194637