Re: 'GROUP BY' / 'DISTINCT' interaction bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mark Hollomon" <mhh(at)nortelnetworks(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 'GROUP BY' / 'DISTINCT' interaction bug?
Date: 2000-08-07 15:59:38
Message-ID: 6345.965663978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Mark Hollomon" <mhh(at)nortelnetworks(dot)com> writes:
> 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

Why do you think that's a bug? The DISTINCT clause requires use of
the ungrouped value of i, doesn't it?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Swan 2000-08-07 16:01:36 UNIONS
Previous Message Tom Lane 2000-08-07 15:57:30 Re: mac.c