i have a query which returns ~ 97k records because i am using an inner join. Now i want to use left join to show also the null records on the right table(should be about 300k records). This is the actual query(INNER JOIN):
select artnr as "Article number", ardbez1 as "Article description ", arpadrnr as "Supplier code", cd.ADPPHYSLAND as "Country of this supplier code", p.adrnr as "Parent supplier code", p.adrkname as "Name of parent", pd.ADPPHYSLAND as "Country of parent ", arppreis as "Price", arpwae as "Unit", arzwert as "COO", atatarnr as "HS Code"
from mic_ccs_artikel, mic_ccs_artikeldetail, mic_ccs_artikelpreis, mic_dna_adressen c, mic_dna_adrdetail cd, mic_dna_adressen p, mic_dna_adrrelation, mic_dna_adrdetail pd, mic_ccs_artikelzoll, mic_ccs_artikeltarif
where artsid = ardartsid
and arddatstart <= sysdate
and nvl(arddatend, '01.01.4000') >= sysdate
and artsid = arpartsid
and ARPPREISART = 'VP'
and arpdatstart <= sysdate
and nvl(arpdatend, '01.01.4000') >= sysdate
and c.adrsid = cd.adpadrsid
and arpadrnr = c.adrnr
and cd.adpdatvon <= sysdate
and nvl(cd.adpdatbis, '01.01.4000') >= sysdate
and c.adrmandant = 'S1'
and c.adrwerk = 'V1'
and p.adrmandant = 'S1'
and p.adrwerk = 'V1'
and p.adrsid = arlrelsid1
and c.adrsid = arlrelsid2
and p.adrsid = pd.adpadrsid
and pd.adpdatvon <= sysdate
and nvl(pd.adpdatbis, '01.01.4000') >= sysdate
and artsid = arzartsid
and arztyp = 'URLD'
and arzadrnr = c.adrnr
and arzdatstart <= sysdate
and nvl(arzdatend, '01.01.4000') >= sysdate
and artsid = ataartsid
and ATAREGION = 'SE'
and atatarart='EXPORT'
and atadatstart <= sysdate
and nvl(atadatend, '01.01.4000') >= sysdate
;
Then i tried to "convert" it to LEFT JOIN, but it's always showing the same result:
select artnr as "Article number", ardbez1 as "Article description ", arpadrnr as "Supplier code", cd.ADPPHYSLAND as "Country of this supplier code", p.adrnr as "Parent supplier code", p.adrkname as "Name of parent", pd.ADPPHYSLAND as "Country of parent ", arppreis as "Price", arpwae as "Unit", arzwert as "COO", atatarnr as "HS Code"
from mic_ccs_artikel, mic_ccs_artikeldetail, mic_ccs_artikelpreis, mic_dna_adressen c, mic_dna_adrdetail cd, mic_dna_adressen p, mic_dna_adrrelation, mic_dna_adrdetail pd, mic_ccs_artikelzoll, mic_ccs_artikeltarif
where artsid = ardartsid(+)
and arddatstart <= sysdate
and nvl(arddatend, '01.01.4000') >= sysdate
and artsid = arpartsid(+)
and ARPPREISART = 'VP'
and arpdatstart <= sysdate
and nvl(arpdatend, '01.01.4000') >= sysdate
and c.adrsid = cd.adpadrsid(+)
and arpadrnr = c.adrnr
and cd.adpdatvon <= sysdate
and nvl(cd.adpdatbis, '01.01.4000') >= sysdate
and c.adrmandant = 'S1'
and c.adrwerk = 'V1'
and p.adrmandant = 'S1'
and p.adrwerk = 'V1'
and p.adrsid = arlrelsid1(+)
and c.adrsid = arlrelsid2
and p.adrsid = pd.adpadrsid
and pd.adpdatvon <= sysdate
and nvl(pd.adpdatbis, '01.01.4000') >= sysdate
and artsid = arzartsid(+)
and arztyp = 'URLD'
and arzadrnr = c.adrnr
and arzdatstart <= sysdate
and nvl(arzdatend, '01.01.4000') >= sysdate
and artsid = ataartsid(+)
and ATAREGION = 'SE'
and atatarart='EXPORT'
and atadatstart <= sysdate
and nvl(atadatend, '01.01.4000') >= sysdate
;
Why is it always showing the same result?