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

From Jonah H. Harris
Subject Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)
Date
Msg-id 36e682921001290923h42d11678l88b87040206e9caa@mail.gmail.com
Whole thread Raw
In response to Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jan 29, 2010 at 12:09 PM, Jonah H. Harris <jonah.harris@gmail.com> wrote:
On Fri, Jan 29, 2010 at 11:57 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I find it doubtful that it's actually necessary in Oracle's version
of listagg ...

Eh?

http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions087.htm

Defines:
LISTAGG (measure_expr [, 'delimiter_expr'])
WITHIN GROUP (order_by_clause) [OVER query_partition_clause]


SQL Server's listagg is similar to the PG implementation.  It seems Oracle thinks people would prefer to order the list and for that reason, made their listagg a rank function type.  Having done quite a bit of work generating delimited lists/arrays based on ordering in PG, I generally agree that it's what I would generally want.

--
Jonah H. Harris

pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: ordered aggregates using WITHIN GROUP (was Re: can somebody execute this query on Oracle 11.2g and send result?)
Next
From: Robert Haas
Date:
Subject: Re: Hot Standby: Relation-specific deferred conflict resolution