Re: Outer Joins

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Poul L(dot) Christiansen" <poulc(at)cs(dot)auc(dot)dk>, Michael Dunn <michael(at)2cactus(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Outer Joins
Date: 2001-01-28 00:13:56
Message-ID: 0101271913560W.08820@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 23 January 2001 11:30, Bruce Momjian wrote:
> Can someone explain why cname and date from table c gets printed in this
> query?

The query was supposed to be:

SELECT * FROM a FULL OUTER JOIN b USING (id)
RIGHT OUTER JOIN c USING(id);

I missed the end of it when I was writing the email.

> > SELECT * FROM a FULL OUTER JOIN b USING (id) <-- no ';'

> > id | name | aname | name | bname | name | cname | date
> > ----+------+--------+------+--------+------+---------+------------
> > 1 | Bob | aname1 | Bob | bname1 | Bob | cname1 | 2001-01-07
> > 2 | Jim | aname2 | Tom | bname2 | Jim | cname2 | 2001-01-07
> > 9 | | | | | Tom | cname9 | 2001-01-07
> > 10 | | | | | | cname10 | 2001-01-07
> > (4 rows)
>
> ---------------------------------------------------------------------------
>

--
-------- Robert B. Easter reaster(at)comptechnews(dot)com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Culley Harrelson 2001-01-28 01:12:16 Re: simple function syntax
Previous Message Rob Arnold 2001-01-28 00:09:23 Re: MS Excel to PostgreSQL?