pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: ext-thierry.templier@ccf.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Réf. : Re: [SQL] Left outer join
Date: Thu, 23 Oct 2003 16:35:43 +0100
Message-ID: <200310231635.43348.dev@archonet.com> (raw)
In-Reply-To: <OFB97BBE94.5B90D729-ONC1256DC8.004A9770@prod.fr.hsbc>
References: <OFB97BBE94.5B90D729-ONC1256DC8.004A9770@prod.fr.hsbc>

On Thursday 23 October 2003 14:39, ext-thierry.templier@ccf.com wrote:
> Hello,
>
> It doesn't work...

You don't say how. By the way, please try to reply to the list as well as 
directly to the person.

> Have you examples on left outer join on a table that is
> a part of a table? THanks,

richardh=# select * from ta;
 a |  b
---+-----
 1 | aaa
 2 | bbb
 3 | ccc
(3 rows)

richardh=# select * from tb;
 c |  d
---+-----
 1 | fff
 3 | ggg
(2 rows)

richardh=# SELECT a,b,c,d FROM (SELECT a,b FROM ta) AS one LEFT JOIN (SELECT 
c,d FROM tb) AS two ON a=c;
 a |  b  | c |  d
---+-----+---+-----
 1 | aaa | 1 | fff
 2 | bbb |   |
 3 | ccc | 3 | ggg
(3 rows)

-- 
  Richard Huxton
  Archonet Ltd



Message-ID: <200310231635.43348.dev@archonet.com>
Permalink:  ../200310231635.43348.dev@archonet.com/
Also on:    postgresql.org/message-id/200310231635.43348.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, ext-thierry.templier@ccf.com
  Subject: Re: Réf. : Re: [SQL] Left outer join
  In-Reply-To: <200310231635.43348.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox