Subject Re: [IBO] Possible Bug in Parser: Sub-Selects with Integer and Date Fields In Firebird
Author Eduardo Jedliczka
Helen Borrie and Svein,

Thanks for answer.

Well, I know the risk of ambiguous... But setting different aliases for
table CO_LCT, for example Co_LCT A and Co_LCT B, the error is the same. :-(

=======================
Eduardo Jedliczka
Gerasoft - Informática
Apucarana - PR - Brasil
=======================

----- Original Message -----
From: "Svein Erling Tysvaer" <svein.erling.tysvaer@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, July 10, 2003 12:05 PM
Subject: Re: [IBO] Possible Bug in Parser: Sub-Selects with Integer and Date
Fields In Firebird


> At 11:24 10.07.2003 -0300, you wrote:
> >Select Count(Distinct NumLote) as Total,
> >(Select Count(distinct NumLote) from Co_Lct Where
((CodEmpresa=:CodEmpresa)
> >and (Identificacao starting with 'LA'))) as TotLote
> >from Co_Lct where ((CodEmpresa=:CodEmpresa) and (Data between
:DataInicial
> >and :DataFinal))
>
> I think I would have changed this to
>
> Select Count(Distinct NumLote) as Total,
> (Select Count(distinct B.NumLote) from Co_Lct B Where
> ((B.CodEmpresa=A.CodEmpresa)
> and (B.Identificacao starting with 'LA'))) as TotLote
> from Co_Lct A where ((CodEmpresa=:CodEmpresa) and (Data between
:DataInicial
> and :DataFinal))
>
> It surprises me that Firebird 1.5 lets you do your query, since I find it
> ambiguous allowing you to reference CodEmpresa and Identificacao in the
> where clause of the subselect without qualifying them.
>
> Set
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>