Re: [SQL] How to display multiple rows in 1 row - Mailing list pgsql-sql

From David G. Johnston
Subject Re: [SQL] How to display multiple rows in 1 row
Date
Msg-id CAKFQuwZwRnqcHjCKc+seEPAbrkwna-vho1rw+EDZMsSN5kPhFw@mail.gmail.com
Whole thread Raw
In response to [SQL] How to display multiple rows in 1 row  (Baxter Allen <baxter.allen@gmail.com>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [SQL] How to display multiple rows in 1 row
Next
From: Steve Midgley
Date:
Subject: Re: [SQL] How to display multiple rows in 1 row