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

Left Outer Join Syntax

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Left Outer Join Syntax
Date: 2004-08-14 07:33:37
Message-ID: 1092468819.1255.15.camel@retsol1 (view raw or flat)
Thread:
Lists: pgsql-novice
What is the correct syntax for the following.
I have table A joined to table B and C. I also have table A left outer
joined to tables D and E
and in turn D is joined to F

SELECT A.*,B.*,C.*,D.*,E.*,F.*
FROM A
          LEFT OUTER JOIN D
          ON A.colD      = D.colA
          LEFT OUTER JOIN E
           ON A.colE      = E.colA,
         B,
         C
WHERE A.col1 = ?
AND     A.colB = B.colA
AND     A.colC = C.colA

(I know I can move the B and C table joins and make them explicit joins
off A)

How do I include the join of table F to table D where F.colD = D.colF in
the case where 1) F is a LEFT OUTER and 2) where F is plain (INNER?)
join   

Thanks in advance
    


Regards,

Steve Tucknott

ReTSol Ltd

DDI: 01903 828769

Responses

pgsql-novice by date

Next:From: AndreasDate: 2004-08-14 12:06:11
Subject: Re: PGSQL 8-beta For WinXP Home Edition Instructions
Previous:From: Stephan SzaboDate: 2004-08-13 17:43:39
Subject: Re: PGSQL Crossroads

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