Subject Re: [ib-support] Ambiguous query or bug ?
Author Claudio Valderrama C.
""Béru"" <beru@...> wrote in message
news:9ufmae+6h8p@......
> 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.

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.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing