Re: Order By for aggregate functions (Simulating Group_concat)

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Order By for aggregate functions (Simulating Group_concat)
Дата
Msg-id 20050901160532.GA28510@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Order By for aggregate functions (Simulating Group_concat)  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Order By for aggregate functions (Simulating Group_concat)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Thu, Sep 01, 2005 at 05:14:41PM +0200, Martijn van Oosterhout wrote:
> On Thu, Sep 01, 2005 at 10:04:12AM +0100, Charlotte Pollock wrote:
> > What I want to be able to do is pass and order by field to the aggregate so
> > I can be certain I get the list of strings in the correct order.
>
> Order them before the aggregate?
>
> SELECT aggregate(field) FROM (SELECT field FROM xxx ORDER BY wherever) x;

I've occasionally relied on this but I've never been completely
comfortable with it.  Is there any guarantee that the subquery's
ordering will be maintained as rows are fed to the aggregate, or
is that just an accident of the current implementation?

--
Michael Fuhr

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Don't understand transaction error
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Don't understand transaction error