Re: SELECT, GROUP BY, and aggregates

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Cc: Ryan Delaney <ryan(dot)delaney(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT, GROUP BY, and aggregates
Date: 2015-02-13 18:48:13
Message-ID: CAMkU=1yonuNjGhVkMCMfEQfcQF3Guo3YfmeFodaUcKdEN2y5qQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 13, 2015 at 10:26 AM, Bill Moran <wmoran(at)potentialtech(dot)com>
wrote:

>
> > Ryan Delaney <ryan(dot)delaney(at)gmail(dot)com> writes:
> > > Why couldn't an RDBMS such as postgres interpret a SELECT that omits
> the GROUP
> > > BY as implicitly grouping by all the columns that aren't part of an
> aggregate?
>
> I'm Mr. Curious today ...
>
> Why would you think that such a thing is necessary or desirable? Simply
> add the
> columns to the GROUP BY clause and make the request unambiguous.
>
>
Where would the ambiguity be?

I waste an inordinate amount of time retyping select lists over into the
group by list, or copying and pasting and then deleting the aggregate
clauses. It is an entirely pointless exercise. I can't fault PostgreSQL
for following the standard, but its too bad the standards aren't more
sensible.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vasudevan, Ramya 2015-02-13 18:53:42 Re: Question on session_replication_role
Previous Message Bill Moran 2015-02-13 18:26:30 Re: SELECT, GROUP BY, and aggregates