postgresql - How to turn a column of ints into one array in postgres -


i have table 1 column , 400 rows; each row has integer. how can create int array of these integers preserves order?

i using postgresql-9.2.

select array_agg(int_column order some_column) int_array_column the_table; 

where some_column column defines "order" of integer values. rows in relational database not have "an order", request "that preserves order" makes sense if have column defines sort order try preserve.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -