Re: Use of array_agg and array string on inner query
От
shankha
Тема
Re: Use of array_agg and array string on inner query
Дата
Msg-id
CAO_L6qG_UkYqseR8+EZGCO_DAP4ydrwxt8myDES5JhFSagszUA@mail.gmail.com
Ответ на
Re: Use of array_agg and array string on inner query (David G. Johnston)
Список
Дерево обсуждения
Use of array_agg and array string on inner query shankha <shankhabanerjee@gmail.com>
Re: Use of array_agg and array string on inner query Sameer Kumar <sameer.kumar@ashnik.com>
Re: Use of array_agg and array string on inner query shankha <shankhabanerjee@gmail.com>
Re: Use of array_agg and array string on inner query Sameer Kumar <sameer.kumar@ashnik.com>
Re: Use of array_agg and array string on inner query shankha <shankhabanerjee@gmail.com>
Re: Use of array_agg and array string on inner query "David G. Johnston" <david.g.johnston@gmail.com>
Re: Use of array_agg and array string on inner query shankha <shankhabanerjee@gmail.com>
Re: Use of array_agg and array string on inner query "David G. Johnston" <david.g.johnston@gmail.com>
I got the query: SELECT c1, c2, ARRAY_TO_STRING(ARRAY_AGG((SELECT t3.c1 FROM s.t1 as t3 JOIN s.t1 as t2 ON t3.c3 = t2.c2)), ',') FROM s.t1 t1 GROUP BY c1; DROP SCHEMA s CASCADE; Thanks for all the help. Thanks Shankha Banerjee On Wed, May 18, 2016 at 2:40 PM, David G. Johnston wrote: > On Wed, May 18, 2016 at 2:30 PM, shankha 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. > >
В списке pgsql-general по дате отправления