Re: help with aggregation query across a second text array column

Поиск
Список
Период
Сортировка
От Rob Nikander
Тема Re: help with aggregation query across a second text array column
Дата
Msg-id FA3E2516-6BDC-46CB-B5B5-793AED4D7334@gmail.com
обсуждение исходный текст
Ответ на help with aggregation query across a second text array column  (Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>)
Ответы RE: help with aggregation query across a second text array column  (Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>)
Список pgsql-general

> On Nov 12, 2018, at 9:40 AM, Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com> wrote:
> …

I’m not too confident in my answer here (there could be a better way), but this might help. You could use the `unnest`
functionto transform the array into multiple rows. For example, given a table like  

    create table t1 (env text, cls text, cls2 text[]);

I can query it like:

    select env, string_agg(cls, ‘,’)
      from (select env, cls from t1
               union
               select env, unnest(cls2) from t1) t
    group by env;

Rob

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: libwinpthread-1.dll missing in PostgreSQL 11.0-1 for Windows
Следующее
От: Marko Krajnc
Дата:
Сообщение: Re: libwinpthread-1.dll missing in PostgreSQL 11.0-1 for Windows