Re: Question on the right way to think about order by

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Question on the right way to think about order by
Дата
Msg-id CAKFQuwbVVTAPyXc7dRoooiMnbGFdHosKF44jusm91VUNF89y-g@mail.gmail.com
обсуждение исходный текст
Ответ на Question on the right way to think about order by  (Paula Kirsch <pl.kirsch@gmail.com>)
Список pgsql-general
On Tuesday, July 3, 2018, Paula Kirsch <pl.kirsch@gmail.com> wrote:
When I think about order by in an aggregate statement, e.g.

select string_agg(product, ' | ' order by product) from products;

is it correct to think of order by as a parameter passed to string_agg?

For a user it's simply the order that rows are passed into the function.  If the state transition aspect retains order this is how you can control it.  The function itself doesn't really ever see the parameter, it just sees ordered data.

David J.

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

Предыдущее
От: Paula Kirsch
Дата:
Сообщение: Question on the right way to think about order by
Следующее
От: Mathieu PUJOL
Дата:
Сообщение: Re: Analyze plan of foreign data wrapper