Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group