From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ehab Galal <ehabgalal123@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL command join question
Date: Wed, 29 Nov 2006 20:02:34 -0500
Message-ID: <6756.1164848554@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY24-F23D89B0EEF2CFB0C611FFA96DB0@phx.gbl>
References: <BAY24-F23D89B0EEF2CFB0C611FFA96DB0@phx.gbl>
"Ehab Galal" <ehabgalal123@hotmail.com> writes:
> 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);
> 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.
Drop the alias on the outer join (the "t"). Per SQL spec, that masks
table names (and aliases) within the join from the rest of the query.
regards, tom lane
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: tgl@sss.pgh.pa.us, ehabgalal123@hotmail.com
Subject: Re: SQL command join question
In-Reply-To: <6756.1164848554@sss.pgh.pa.us>
* 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