Subject Re: grouping with an "as" field
Author lartz001
Thanks for the replies, the order by 2 will be what I need thanks :),
didnt know you could order by field number..

--- In firebird-support@yahoogroups.com, João Toledo
<joao.toledo@f...> wrote:
> 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
> >
> >
> >
> >
> >
> >
> >