'GROUP BY' / 'DISTINCT' interaction bug?

From: "Mark Hollomon" <mhh(at)nortelnetworks(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: 'GROUP BY' / 'DISTINCT' interaction bug?
Date: 2000-08-07 15:07:03
Message-ID: 398ED097.4B3AA031@americasm01.nt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Is this a known problem? Is there a work-around?

create table t (c char, i int);
insert into t values ('a', 1);
insert into t values ('a', 1);
insert into t values ('a', 2);
insert into t values ('b', 2);

select distinct on (c, i) c, count(i) from t group by c;
ERROR: Attribute t.i must be GROUPed or used in an aggregate function

--

Mark Hollomon
mhh(at)nortelnetworks(dot)com
ESN 451-9008 (302)454-9008

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-07 15:35:23 Re: was: bad datatypes time and timestamp - wrong gcc option
Previous Message Thomas Lockhart 2000-08-07 15:03:24 Re: AW: Questionable coding in proc.c & lock.c