Re: Basic SQL join question

From: Arjen van der Meijden <acm(at)tweakers(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Basic SQL join question
Date: 2003-01-31 09:16:24
Message-ID: b1desm$cjd$1@news.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hervé Piedvache 2003-01-31 09:19:49 ALTER STATISTIC and dump ?
Previous Message Martin Kutschker 2003-01-31 07:38:18 Again