Subject Re: [firebird-support] grouping with an "as" field
Author João Toledo
try:

select distinct(fielda),
count(*) as amount
from table
group by fielda
order by 2 <--- the second field


João


lartz001 wrote:
> 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?
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>