Subject Re: Odd problem
Author Adam
> > Your case looks like an extension to this. It is doing a join to
> > itself, and would therefore have two fields named test_id. In
> > case, it chooses the "wrong" one.
> But its not ambiguous. There are two tables in the from part of
> select. One named test and the other parent (which is an alias to
> test table) and so you should have two columns of test_id but one
> the table test and the other for parent and I explicitly specify in
> select that I want the test.test_id and not parent.test_id so there
> no ambiguity that I can see.

You missed my point. It is not ambiguous on your query. It is
ambiguous because of how FB 1.5 implements it. This query may well
work in Firebird 2 (or it may not, but you can test it)

Added confirmation is that it works
> properly in the other databases I've tried and that Firebird
> trigger the abiguity error that it does now when it thinks its

2 words, Backwards compatibility

Firebird has being getting more and more strict with ambiguous
queries. For example

select ID
from tableA a
join table B b on (

would return something in FB 1 and IB6, but in FB 1.5, you will get

Dynamic SQL Error
-SQL error code = -204
-Ambiguous field name between table tableA and table tableBDynamic

> > The work around is simple, use aliases for both tables as you
> > done in your second example.
> It should not be needed and I suspect the SQL specs would agree
with me
> on this and that Firebird is getting it wrong. Or perhaps this is
> case where the SQL specs are themselves ambiguous but I still think
> Firebird is getting it wrong.

Yes it is, but seriously, use aliases and get on with life.