Subject | Re: [firebird-support] Firebird 2.1 : left join right join full join outer join dont' work ! |
---|---|
Author | Hannes Streicher |
Post date | 2010-09-01T09:55:08Z |
Guten Tag Philipp Franzos,
Mit freundlichen Grüssen
Hannes Streicher mailto:HStreicher@...
> Hi HTHcheck the coalesce function
> who ever you are, thank you it works !
> Bit how do I get blank instead of NULL in the result table ?
> Regards--
> Philipp
> 2010/9/1 Svein Erling Tysvær <svein.erling.tysvaer@...>
>>
>>
>> Two things:
>>
>> 1) Don't mix SQL-89 (implicit JOIN) and SQL-92 (explicit JOIN).
>> 2) Referring to KO.TYP in the WHERE clause in reality changes the left join
>> to an inner join.
>>
>> So, assuming you really want a left join, change to:
>>
>> SELECT DISTINCT
>> PR.SUCHBEGRIFF as Liegenschaft,
>> AD.VORNAME,
>> AD.NAME1,
>> KO.NUMMER,
>> KO.TYP
>> FROM ADRESSE ad
>> JOIN ADRESSE_ADRESSKATEGORIE aa on AA.ADRESSE_ID = AD.ID
>> JOIN ADRESSKATEGORIE ak on AK.ID = AA.ADRESSKATEGORIE_ID
>> JOIN VERTEILEREINTRAG ve on VE.ADRESSE_ID = AD.ID
>> JOIN PROJEKT pr on VE.VERTEILER_ID = PR.BETEILIGTEVERTEILER_ID
>> left join KOMMUNIKATION ko on AD.ID = KO.ADRESSE_ID and KO.TYP = 'Privat'
>> WHERE
>> AK.SUCHBEGRIFF = 'Hauswart'
>>
>> And see if that eliminates your problem.
>>
Mit freundlichen Grüssen
Hannes Streicher mailto:HStreicher@...