'GROUP BY' / 'DISTINCT' interaction bug? - Mailing list pgsql-hackers

From Mark Hollomon
Subject 'GROUP BY' / 'DISTINCT' interaction bug?
Date
Msg-id 398ED097.4B3AA031@americasm01.nt.com
Whole thread Raw
Responses Re: 'GROUP BY' / 'DISTINCT' interaction bug?
List 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@nortelnetworks.com
ESN 451-9008 (302)454-9008


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: AW: Questionable coding in proc.c & lock.c
Next
From: Thomas Lockhart
Date:
Subject: Re: was: bad datatypes time and timestamp - wrong gcc option