Subject | Re: [firebird-support] grouping with an "as" field |
---|---|
Author | João Toledo |
Post date | 2004-07-27T14:05:38Z |
try:
select distinct(fielda),
count(*) as amount
from table
group by fielda
order by 2 <--- the second field
João
lartz001 wrote:
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
>
>
>
>
>
>
>