pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Witham <davidw@unidial.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Sorting an aggregated column
Date: Tue, 23 Mar 2004 00:17:24 -0500
Message-ID: <15732.1080019044@sss.pgh.pa.us> (raw)
In-Reply-To: <CFA248776934FD43847E740E43C346D199DCAA@ozimelb03.ozicom.com>
References: <CFA248776934FD43847E740E43C346D199DCAA@ozimelb03.ozicom.com>

"David Witham" <davidw@unidial.com.au> writes:
> This output is correct in this case but there is no guarantee that the
> answers will come out in "question" order. I can't see how to
> incorporate sorting by the "question" column using this approach.

As of PG 7.4 you can reliably use a sorted sub-select to determine the
order of inputs to a user-defined aggregate function.  See for instance
http://archives.postgresql.org/pgsql-general/2003-02/msg00917.php

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <15732.1080019044@sss.pgh.pa.us>
Permalink:  ../15732.1080019044@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15732.1080019044@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, davidw@unidial.com.au
  Subject: Re: Sorting an aggregated column
  In-Reply-To: <15732.1080019044@sss.pgh.pa.us>

* 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