Re: How to display multiple rows in 1 row

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Steve Midgley <science(at)misuse(dot)org>
Cc: Baxter Allen <baxter(dot)allen(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: How to display multiple rows in 1 row
Date: 2017-01-11 03:40:57
Message-ID: CAKFQuwYLEsEJd-NyGbEa=XFMW3PWLKXayjkOo=Zj_btXAjkkEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, January 10, 2017, Steve Midgley <science(at)misuse(dot)org> wrote:

>
> Given the DDL at the bottom of my email (what I used to test), this sql
> statement works, I think:
>
> select * from
> (select a.id as a_id, * from table_a a
> left join table_b b on a.id=b.id) a1
> join table_c c on a1.a_id = c.id
>
>
> Returns
>
> "1.table_c";"1.table_c";1;"";;;"1.table_c";4;3
> "2.table_c";"2.table_c";2;"";;;"2.table_c";3;4
> "3.table_c";"3.table_c";3;"";;;"3.table_c";2;21
>
>
Aside from executing without error I don't see how this works at all.
You cannot solve the posed problem by rearranging simple joins.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David G. Johnston 2017-01-11 03:55:49 Re: How to display multiple rows in 1 row
Previous Message Steve Midgley 2017-01-11 03:11:19 Re: How to display multiple rows in 1 row