On Wed, May 18, 2016 at 2:30 PM, shankha <shankhabanerjee(at)gmail(dot)com> wrote:
> I cannot move the array_agg to around the column name. It has to work
> as a inner query
> .
>
The following form is used to make an array from a subquery:
SELECT ARRAY(SELECT i FROM ( VALUES (1), (2), (3) ) vals (i) );
http://www.postgresql.org/docs/9.5/static/sql-expressions.html
4.2.12; last example
Not the most obvious place...
David J.