hi

my understanding from SQL sequence is:

from - where - group by - having - select - order by - limit

but

with tbase(id)
as (select 1 union all select 2)
select id otto from tbase
group by otto
order by otto

works (how does the group by know about otto if the sequence is done as described above?)

also the having after the group by doesn't know about otto (which in my thoughts is correct)

So i think its good if

a) the group by also doesn't know about otto

b) also the havings can interpret the alias otto

But today its half/half so its not good.

hape