Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, July 3, 2018, Paula Kirsch <pl.kirsch@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux