Oracle Outer Join Syntax Old Style - Why look for a (+) on the right side of the equal sign in the left outer join?

I always tell new people that the easy way to remember the old style, Oracle's external syntax is that

the (+) sign is on the opposite side where you think it should be.

Left connection:

select * from foo, bar where foo.id = bar.id(+) 

Right connection:

 select * from foo, bar where foo.id(+) = bar.id 

I'm sure I found out about this in college, but what is the purpose of having a (+) sign on both sides? Does this simply mean "even those lines on the other hand that do not match on this side"? but it would seem too complicated. What was the purpose of choosing "(+)" and putting it on the side where there was no coincidence?

+6
source share
1 answer

(+) denotes the table to which the outer join is bound. As I taught, (+) indicated a table in which there were no rows for which it was necessary to add new NULL rows.

If you look at the alternative syntaxes for the left outer join , then the various databases supported before the LEFT OUTER JOIN became part of the ANSI standard, a private statement was usually applied to a table that was a "missing" row. DB2 also supports the (+) operator for external connections in the same way as Oracle does.

+10
source

All Articles