Subject | Re: [IBO] IB_Query phenomenom |
---|---|
Author | Geoff Worboys |
Post date | 2001-01-03T03:26:56Z |
> Your query works, thanks. But it doesn't solve my problem, evenI was wondering whether you may actually want an outer join.
> with explicit JOINs only the current row displays the correct
> data.
Something like...
FD.FDID,FD.FDDCID,FD.FDDFID,FD.FDBONUS,
A.FMID,A.FMFDID,A.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
MPID=A.FMMPID) as AMPNAME,A.FMDISCOUNT,A.FMDISCOUNTNEW
,
B.FMID,B.FMFDID,B.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
MPID=B.FMMPID) as BMPNAME,B.FMDISCOUNT,B.FMDISCOUNTNEW
,
C.FMID,C.FMFDID,C.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
MPID=C.FMMPID) as CMPNAME,C.FMDISCOUNT,C.FMDISCOUNTNEW
from FOLLOWUPDISCOUNTS FD
left outer join FOLLOWUPDISCOUNTS_MP A
on A.FMFDID=FD.FDID
left outer join FOLLOWUPDISCOUNTS_MP B
on B.FMFDID=FD.FDID
left outer join FOLLOWUPDISCOUNTS_MP C
on C.FMFDID=FD.FDID
where A.FMMPID=11 and B.FMMPID=12 and C.FMMPID=13
In this way you are selecting ALL records from "FOLLOWUPDISCOUNTS FD"
that match the required criteria and not just the intersections
calcuated with default (inner) joins.
Note also the renamed aliases: AMPNAME, BMPNAME etc.
Just a thought.
Geoff Worboys
Telesis Computing