Subject Re: [IBO] IB_Query phenomenom
Author guido.klapperich@t-online.de
Your query works, thanks. But it doesn't solve my problem, even with explicit
JOINs only the current row displays the correct data.

Helen Borrie wrote:

> At 08:23 PM 02-01-01 +0100, you wrote:
> >I have a IB_Query with the following SQL-Statement:
> >select
> >FD.FDID,FD.FDDCID,FD.FDDFID,FD.FDBONUS,
> >A.FMID,A.FMFDID,A.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
> >MPID=A.FMMPID) as MPNAME,A.FMDISCOUNT,A.FMDISCOUNTNEW
> >,
> >B.FMID,B.FMFDID,B.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
> >MPID=B.FMMPID) as MPNAME,B.FMDISCOUNT,B.FMDISCOUNTNEW
> >,
> >C.FMID,C.FMFDID,C.FMMPID,(select MPNAME from MAINPRODUCTGROUPS where
> >MPID=C.FMMPID) as MPNAME,C.FMDISCOUNT,C.FMDISCOUNTNEW
>
> from FOLLOWUPDISCOUNTS FD
>
> join FOLLOWUPDISCOUNTS_MP A
> on A.FMFDID=FD.FDID
>
> join FOLLOWUPDISCOUNTS_MP B
> on B.FMFDID=FD.FDID
>
> join FOLLOWUPDISCOUNTS_MP C
> on C.FMFDID=FD.FDID
>
> where A.FMMPID=11 and B.FMMPID=12 and C.FMMPID=13
>
> btw, the joinlinks you are using won't work because you need the actual
> table identifier, not an alias. Thus I believe that you have no choice but
> to use explicit join syntax for a re-entrant query like this.
>
> Cheers,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________