Here's some better example of where this is really a problem (the initial queries just illustrated what we are talking about).
select a from A a order by a
is valid.
We want (its a long standing feature request) to also allow:
select a+1 as b from A a order by b
The first query uses the from-clause declared alias as an expression in the order by. The second query uses the select-clause declared alias as an expression in the order by.
So now take a query that allows the duplicate alias:
select a.something as a from A a
You said you want to allow this. But now consider:
select a.something as a from A a order by a
What does a in order by a mean?
|