Re: Turning column into *sorted* array? - Mailing list pgsql-sql

From PFC
Subject Re: Turning column into *sorted* array?
Date
Msg-id op.sqzf0iuuth1vuj@localhost
Whole thread Raw
In response to Turning column into *sorted* array?  ("Felix E. Klee" <felix.klee@inka.de>)
Responses Re: Turning column into *sorted* array?
List pgsql-sql

> SELECT array_accum(x) FROM (SELECT * FROM some_view ORDER BY x) AS tmp;
If you're using integers, you could use the int_array_accum or something  from the intarray module which is a lot
faster.Ibelieve intarray also has a function for sorting integer arrays...
 

>
> BTW, the best alternative (in terms of execution performance) that comes
> into my mind is to create an aggregate that does the sorting right away
> while the values "come in" from the rows.  But that'd probably take me
> some time to get right.
>




pgsql-sql by date:

Previous
From: Ragnar Hafstað
Date:
Subject: Re: Changed to: how to solve the get next 100 records problem
Next
From: "Felix E. Klee"
Date:
Subject: Re: Turning column into *sorted* array?