Re: MULTIPLE OUTER JOIN SYNTAX :-( can't quess it

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Constantin Teodorescu <teo(at)flex(dot)ro>
Cc: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: MULTIPLE OUTER JOIN SYNTAX :-( can't quess it
Date: 2001-04-30 19:05:37
Message-ID: 17688.988657537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Constantin Teodorescu <teo(at)flex(dot)ro> writes:
> I want a select query with them with 2 outer joins like that
> t0.id = t1.author
> t0.id = t2.id
> Tried :
> select t0.name, t1.title, t2.nickname from authors t0 left outer JOIN
> books t1 ON (t0."id"=t1."author") , authors t0 left outer join nicknames
> t2 on (t0."id"=t2."id")
> but it says "author table declared more than once".

select t01.name, t01.title, t2.nickname from
(authors t0 left outer join books t1 on (t0."id"=t1."author")) t01
left outer join
nicknames t2 on (t01."id"=t2."id") ;

There are variants but that's the basic idea...

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ludek Finstrle 2001-05-01 08:32:37 libpgtcl and WinNT
Previous Message Bruce Momjian 2001-04-30 15:58:08 Re: libpgtcl and passwords