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
Post a Comment