pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tjk@tksoft.com <tjk@tksoft.com>
To: pgsql-sql@postgreSQL.org
Subject: group by
Date: Sat, 4 Dec 1999 19:49:29 -0800 (PST)
Message-ID: <199912050349.TAA01753@uno.tksoft.com> (raw)

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

 




view thread (5+ messages)  latest in thread

Message-ID: <199912050349.TAA01753@uno.tksoft.com>
Permalink:  ../199912050349.TAA01753@uno.tksoft.com/
Also on:    postgresql.org/message-id/199912050349.TAA01753@uno.tksoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tjk@tksoft.com
  Subject: Re: group by
  In-Reply-To: <199912050349.TAA01753@uno.tksoft.com>
  References: <199912050349.TAA01753@uno.tksoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox