Subject | Re: [firebird-support] select help needed |
---|---|
Author | André Knappstein, Controlling |
Post date | 2010-01-27T12:03:01Z |
WFB> In other words I want all rows with "LANG_CODE5" = 'FR_fr", plus all
WFB> with "EN_en" where there is no corresponding "FR_fr".
Try the following. But I wrote that together quickly and am not sure
if it works as desired for you:
Select
T1.ID
from
TheTable T1
where
T1.Lang_Code5 = 'FR_fr'
UNION
Select
T2.ID
from
TheTable T2
left outer join
TheTable T3
on T2.Code_ID = T3.Code_ID
and
T3.Lang_Code5 = 'FR_fr'
where
T2.Lang_Code5 = 'EN_en'
and
T3.ID is null
WFB> with "EN_en" where there is no corresponding "FR_fr".
Try the following. But I wrote that together quickly and am not sure
if it works as desired for you:
Select
T1.ID
from
TheTable T1
where
T1.Lang_Code5 = 'FR_fr'
UNION
Select
T2.ID
from
TheTable T2
left outer join
TheTable T3
on T2.Code_ID = T3.Code_ID
and
T3.Lang_Code5 = 'FR_fr'
where
T2.Lang_Code5 = 'EN_en'
and
T3.ID is null