Subject | grouping with an "as" field |
---|---|
Author | lartz001 |
Post date | 2004-07-27T13:47:09Z |
if i have something like:
select distinct(fielda),count(*) as amount from table group by fielda
order by amount desc;
this does not work
but:
select distinct(fielda),count(*) as amount from table group by fielda
order by count(*) desc;
does
how would i order by the "as" defined field?
select distinct(fielda),count(*) as amount from table group by fielda
order by amount desc;
this does not work
but:
select distinct(fielda),count(*) as amount from table group by fielda
order by count(*) desc;
does
how would i order by the "as" defined field?