Re: Order By for aggregate functions (Simulating Group_concat)
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Order By for aggregate functions (Simulating Group_concat) |
| Дата | |
| Msg-id | 4849.1125598036@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Order By for aggregate functions (Simulating Group_concat) (Michael Fuhr <mike@fuhr.org>) |
| Список | pgsql-general |
Michael Fuhr <mike@fuhr.org> writes:
> On Thu, Sep 01, 2005 at 05:14:41PM +0200, Martijn van Oosterhout wrote:
>> 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?
Well, it's not required by the SQL spec (in fact I believe ORDER BY
inside a subselect isn't even legal per the SQL spec) ... but we do
promise it in the current implementation and I doubt we'd break the
promise in future, because it is a mighty handy behavior for
user-defined aggregates.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера