Skip site navigation (1) Skip section navigation (2)

Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)
Date: 2010-01-29 16:57:02
Message-ID: 4955.1264784222@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> So that's how Oracle supports ordered aggregates?  Interesting -- we
> just got that capability but using a different syntax.  Hmm, the
> SQL:200x draft also has <within group specification> which seems the
> standard way to do the ORDER BY stuff for aggregates ...  Should we
> change the syntax?

No.  The syntax we are using is also standard.  As best I can tell,
WITHIN GROUP means something different --- the spec only defines it
for rank functions (RANK | DENSE_RANK | PERCENT_RANK | CUME_DIST)
and it's basically a shorthand form of a window function call.
I find it doubtful that it's actually necessary in Oracle's version
of listagg ...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Stefan KaltenbrunnerDate: 2010-01-29 17:00:16
Subject: Re: Hot Standby: Relation-specific deferred conflict resolution
Previous:From: Boszormenyi ZoltanDate: 2010-01-29 16:48:56
Subject: NaN/Inf fix for ECPG Re: out-of-scope cursor errors

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group