group by - Mailing list pgsql-sql

From tjk@tksoft.com
Subject group by
Date
Msg-id 199912050349.TAA01753@uno.tksoft.com
Whole thread Raw
Responses Re: [SQL] group by
List pgsql-sql
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

pgsql-sql by date:

Previous
From:
Date:
Subject: Re: [SQL] Postgres Date/Time Special Constants
Next
From: Tom Lane
Date:
Subject: Re: [SQL] group by