Subject | Re: grouping with an "as" field |
---|---|
Author | lartz001 |
Post date | 2004-07-27T14:07:44Z |
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:
didnt know you could order by field number..
--- In firebird-support@yahoogroups.com, João Toledo
<joao.toledo@f...> wrote:
> try:fielda
>
> 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
> > order by amount desc;fielda
> >
> > this does not work
> >
> > but:
> >
> > select distinct(fielda),count(*) as amount from table group by
> > order by count(*) desc;
> > does
> >
> > how would i order by the "as" defined field?
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >