RE: [HACKERS] select count(*) from hits group by count;

From: Dmitry Samersoff <dms(at)wplus(dot)net>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: RE: [HACKERS] select count(*) from hits group by count;
Date: 2000-01-29 16:40:04
Message-ID: XFMail.20000129194004.dms@wplus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 29-Jan-2000 Oleg Bartunov wrote:
> Hi there,
> and query:
> discovery=> select count(*) from hits group by count;
> ERROR: Aggregates not allowed in GROUP BY clause
>
> There's easy workaround :
> discovery=> select count(*) as qq from hits group by count;
> but I'm curious is this a valid query ?
> Last snapshot also behave like 6.5.3
>
>
> Another question:
> discovery=> select count(*) as qqq,* from hits group by last_access;
> produces error:
> ERROR: Illegal use of aggregates or non-group column in target list

AFAIK, MS SQL, Sybase and Informix have the same restrictions,
because using all fields in query with aggregates and grouping
is meaningless. Order of fields in group by clause also significant.

--
Dmitry Samersoff, dms(at)wplus(dot)net, ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2000-01-29 16:51:27 Re: [HACKERS] Re: Copyright
Previous Message Tom Lane 2000-01-29 16:24:58 Re: [HACKERS] select count(*) from hits group by count;