Re: Use of array_agg and array string on inner query

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: shankha <shankhabanerjee(at)gmail(dot)com>
Cc: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Use of array_agg and array string on inner query
Date: 2016-05-18 18:40:32
Message-ID: CAKFQuwY7hZyc3ipgkT_VV+bsa0Mp_5qcx=33wPuSiDVoSUr+KQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.​

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo M. Ramé 2016-05-18 19:23:35 Londiste 3 pgq events_1_1 table huge
Previous Message shankha 2016-05-18 18:30:24 Re: Use of array_agg and array string on inner query