'GROUP BY' / 'DISTINCT' interaction bug?
Mark Hollomon <mhh@nortelnetworks.com>
From: "Mark Hollomon" <mhh@nortelnetworks.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2000-08-07T15:07:03Z
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@nortelnetworks.com
ESN 451-9008 (302)454-9008