Basic SQL join question

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Basic SQL join question
Date: 2003-01-31 03:08:24
Message-ID: 3E39E8A8.7020001@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

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

Thanks,

Jc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2003-01-31 03:34:54 Re: text searching in postgres
Previous Message Tom Lane 2003-01-31 01:34:45 Re: Weird query plans for my queries, causing terrible performance.