Re: Sorting an aggregated column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Witham" <davidw(at)unidial(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Sorting an aggregated column
Date: 2004-03-23 05:17:24
Message-ID: 15732.1080019044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"David Witham" <davidw(at)unidial(dot)com(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message David Witham 2004-03-23 07:17:51 Re: Sorting an aggregated column
Previous Message David Witham 2004-03-23 03:26:15 Sorting an aggregated column