Group by calculated column?
223563Oct 20 2004 — edited Oct 20 2004How can one group by a colum that is derived? E.g.
select
a.col1,
a.col2,
(select count(*) from table_b b where b.ix=a.ix) as foo,
count(*)
from
table_a a
group by ??????
Unlike "order by" I cannot simply "group by 1,2,3", and calling out the volumn alias "foo" doesn't work either.