Re: Réf. : Re: [SQL] Left outer join - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Réf. : Re: [SQL] Left outer join
Date
Msg-id 200310231635.43348.dev@archonet.com
Whole thread Raw
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Chris Gamache
Date:
Subject: Re: Query planner: current_* vs. explicit date
Next
From: Matias Surdi
Date:
Subject: Regular expression problem