Re: SQL question re aggregates & joins - Mailing list pgsql-general

From Tom Lane
Subject Re: SQL question re aggregates & joins
Date
Msg-id 15678.1264718182@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL question re aggregates & joins  (Scott Ribe <scott_ribe@killerbytes.com>)
List pgsql-general
Scott Ribe <scott_ribe@killerbytes.com> writes:
> Given that t2.id is the primary key, grouping by any other column of t2 is
> really redundant. I know *what* SQL won't allow me to do, I'm interested in
> knowing if there's some reason *why* other than historical...

SQL92 says so.  More recent versions of the SQL spec describe allowing
omission of grouping columns when one of them can be proven unique,
but it's complicated and we haven't got round to doing it.

            regards, tom lane

pgsql-general by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: SQL question re aggregates & joins
Next
From: Mike Bresnahan
Date:
Subject: Re: Amazon EC2 CPU Utilization