Re: [SQL] How to display multiple rows in 1 row

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [SQL] How to display multiple rows in 1 row
Дата
Msg-id CAKFQuwZwRnqcHjCKc+seEPAbrkwna-vho1rw+EDZMsSN5kPhFw@mail.gmail.com
обсуждение исходный текст
Ответ на [SQL] How to display multiple rows in 1 row  (Baxter Allen <baxter.allen@gmail.com>)
Список pgsql-sql
On Tuesday, January 10, 2017, Baxter Allen <baxter.allen@gmail.com> wrote:

Instead, I would like the output for each individual to be all on a single row:
individual_idvalAvalB_idvalCvalD
11.table_b121.table_c43
22.table_b472.table_c34
33.table_b543.table_c221


The other approach is to "GROUP BY individual" and wrap every other column in an aggregate function that retains the first non-null value in the group (of which there should only be one).  I don't recall there being a built-in to do this but I'm certain it can be manually added and examples found on the internet.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [SQL] How to display multiple rows in 1 row
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: [SQL] How to display multiple rows in 1 row