From: Ehab Galal <ehabgalal123@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: SQL command join question
Date: Wed, 29 Nov 2006 19:41:42 -0500
Message-ID: <BAY24-F23D89B0EEF2CFB0C611FFA96DB0@phx.gbl> (raw)
Hi,
I have three tables t1(a, b, c, d), t2(a, b, c, k), and t3(c, e). I need to
outer join them as shown below, but only have all tuples from t1 as output.
But the following syntax does not allow me to do so.
SELECT t1.*
FROM (t1 outer join t2 on (t1.a=t2.a and t1.b=t2.b)) t outer join t3 on
(t1.c=t3.c);
I'm getting the following error message:
ERROR: invalid reference to FROM-clause entry for table "t1"
HINT: There is an entry for table "t1", but it cannot be referenced from
this part of the query.
I'll be grateful if someone may help me with this.
Thanks,
Ehab
_________________________________________________________________
Fixing up the home? Live Search can help
http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmem...
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: ehabgalal123@hotmail.com
Subject: Re: SQL command join question
In-Reply-To: <BAY24-F23D89B0EEF2CFB0C611FFA96DB0@phx.gbl>
* 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