Received: from as.tksoft.com (gyw.com [209.55.67.177] (may be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id AAA38069 for ; Sun, 5 Dec 1999 00:20:07 -0500 (EST) (envelope-from tjk@tksoft.com) Received: (from tjk@tksoft.com) by uno.tksoft.com (8.8.8/8.8.8) id TAA01753; Sat, 4 Dec 1999 19:49:29 -0800 From: "tjk@tksoft.com" Message-Id: <199912050349.TAA01753@uno.tksoft.com> Subject: group by To: pgsql-sql@postgreSQL.org Date: Sat, 4 Dec 1999 19:49:29 -0800 (PST) Content-Type: text Is there something amiss with the "GROUP BY" clause? I never had any problems with it, but I was just doing a query trying to eliminate duplicates from a list using GROUP BY on one of the fields, and I got an "Illegal use of aggregates or non-group column in target list" error. E.g. "select email,username from emails group by email" produces the error. "select email from emails group by email" works, and so does "select distinct on email email,username from emails" My PG version is 6.5.3. "distinct on columnname" works and does the job, but I am curious if I am brainfarting or if this is a real change. Thanks, Troy