Re: Many aggregates in one query

From: Aakash Bordia <a_bordia_at_hotmail.com>
Date: Fri, 17 Aug 2001 14:13:58 -0700
Message-ID: <9lk0tm$g6u$1_at_stlnews.stl.ibm.com>


Try this on Sybase...
SELECT col1,COUNT(*) FROM IN1 group by col1 order by count(*),col1 fetch first 1 rows only
Thanks
Aakash

"Matti Teppo" <matti.teppo_at_nospam.deio.net> wrote in message news:3B7CD02D.2F282C07_at_nospam.deio.net...
> > If you're using mySQL you can use the LIMIT clause which is specific to
 this
> > DBMS and do the following :
> > SELECT wsid, count(wsid) AS rowcnt
> > FROM test
> > GROUP BY wsid
> > ORDER BY rowcnt ASC
> > LIMIT 1;
> >
> > You just get the first result.
>
> Thank you, but I use Sybase so LIST is not available.
>
> > > I have a problem, for which I'm sure there is a simple answer but I
> > > can't see it.
>
> So this is not as simple as I thought...
>
Received on Fri Aug 17 2001 - 23:13:58 CEST

Original text of this message