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!

LEFT JOIN increases row count

metalrayMar 5 2015 — edited Mar 6 2015

Hi Guys,

I got a problem, my left join retrieves to many values. I know there are only 252 in there that match the where

condition. If I use the table in a left join with the same where condition my row count increases.

 

--1176 rows

select count(erg_ID) from 

myschema.T_STA_ERG sta_erg

INNER JOIN T_MEN hoechst

             ON  sta_erg.PARAMETER = hoechst.PARAMETER 

            AND sta_erg.JAHR = 2014

where sta_erg.MESSERG_KNG = 'A' AND   sta_erg.MESSERG_ALPHA IN ('03') and sta_erg.NORM_MESS is null

--252 rows

select distinct erg_ID from myschema.T_STA_ERG sta_erg where sta_erg.MESSERG_KNG = 'A' AND   sta_erg.MESSERG_ALPHA IN ('03') and sta_erg.NORM_MESS is null

any clue´s how I can build in conditions into my join that would not increase the row results?

This post has been answered by John Stegeman on Mar 6 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2015
Added on Mar 5 2015
8 comments
4,113 views