Subject Re: Ambiguous query or bug ?
Author dianeb77x
--- In ib-support@y..., "Claudio Valderrama C." <cvalde@u...> wrote:
> ""Béru"" <beru@m...> wrote in message
> news:9ufmae+6h8p@e...
> > JJM posted the following problem on the french IB newsgroup:
> >
> > > SELECT RQSEL.D_KEYID
> > > FROM RQSEL
> > > INNER JOIN RQSEL R1
> > > ON (RQSEL."D_KEYID" = R1."D_KEYID")
> > > WHERE
> > > (RQSEL.WO_WORD = 'CIVILES' AND R1.WO_WORD = 'ADMIN')
>
> It's ambiguous: one of the table instances is not qualified, so what
should
> the engine use? When a table appears twice, both places should carry
an
> alias. Otherwise, results are almost random.

What's ambiguous here? One instance is "RQSEL", the other is "R1".
As far as I can see, all column references are qualified with one name
or the other.
What's not to like?

>
> BTW, MsSQL has a rule: once you introduce an alias, you cannot refer
to the
> qualifier by its original name. I think it's fine since it helps
avoiding
> mistakes.

That makes sense -- once you introduce an alias, that now *is* the
name of the table or column.


db