Re: Basic SQL join question - Mailing list pgsql-general

From Arjen van der Meijden
Subject Re: Basic SQL join question
Date
Msg-id b1desm$cjd$1@news.tudelft.nl
Whole thread Raw
In response to Basic SQL join question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
Jean-Christian Imbeault wrote:
> Sorry for this simple question but I can't seem to get Postgres to do
> what I want ...
>
> I want to get the concatenation of 2 or more tables with absolutely
> nothing in common. How can I do this?
You can't, or at least you shouldn't.
If you want to display them inline in your application, try building
some clientside code to display het pretty.

But since there is no relation, the database will never be able to
understand how to put the data together.

>
> For example
>
> Table a:
>
>    a
> -----
>   a1
>   a2
>   a3
>
> Table b:
>
>    b
> -----
>   b1
>   b2
>
> Table c:
>
>    c
> -----
>   c1
>   c2
>   c3
>   c4
>
> What is the proper SQL to return:
>
>    a |  b |  c
> ---------------
>   a1   b1   c1
>   a2   b2   c2
>   a3        c3
>             c4

As far as I know there is no SQL to return that :)

Regards,

Arjen


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Weird query plans for my queries, causing terrible performance.
Next
From: Stephan Szabo
Date:
Subject: Re: Basic SQL join question