Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL JOIN; ON after or before subsequent JOIN Keyword

metalrayNov 18 2014 — edited Nov 28 2014

Hi Guys,

I have spotted a very unusual behaviour that I can't explain.

I have isolated the problem to the following joins.

Why does the second join return less rows? Why does the first JOIN result in more rows?

         LEFT OUTER JOIN DWH.SA_BEZ_SAS_GRUPPE_V stellwerkg 
              INNER JOIN DWH.SA_STELL_V stellwerk   
                      ON (stellwerkg.owner_fid = stellwerk.fid)          
                      ON (stellwerkg.member_fid = vorsignal.fid)
--5413 rows

         LEFT OUTER JOIN DWH.SA_BEZ_SAS_GRUPPE_V stellwerkg
                      ON (stellwerkg.member_fid = vorsignal.fid) 
              INNER JOIN DWH.SA_STELL_V stellwerk   
                      ON (stellwerkg.owner_fid = stellwerk.fid)

--5411 rows

Thanks for any enlightenment.

This post has been answered by Martin Preiss on Nov 20 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2014
Added on Nov 18 2014
21 comments
6,466 views