Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 13E289FB25E for ; Wed, 29 Nov 2006 20:41:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 70626-03 for ; Wed, 29 Nov 2006 20:41:49 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s38.bay0.hotmail.com (bay0-omc3-s38.bay0.hotmail.com [65.54.246.238]) by postgresql.org (Postfix) with ESMTP id B1A389FB1CF for ; Wed, 29 Nov 2006 20:41:49 -0400 (AST) Received: from hotmail.com ([64.4.18.73]) by bay0-omc3-s38.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 29 Nov 2006 16:41:48 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 29 Nov 2006 16:41:48 -0800 Message-ID: Received: from 128.211.252.201 by by24fd.bay24.hotmail.msn.com with HTTP; Thu, 30 Nov 2006 00:41:42 GMT X-Originating-IP: [128.211.252.201] X-Originating-Email: [ehabgalal123@hotmail.com] X-Sender: ehabgalal123@hotmail.com From: "Ehab Galal" To: pgsql-sql@postgresql.org Subject: SQL command join question Date: Wed, 29 Nov 2006 19:41:42 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 30 Nov 2006 00:41:48.0148 (UTC) FILETIME=[51710340:01C71418] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.722 tagged_above=0 required=5 tests=BAYES_40, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, MSGID_FROM_MTA_HEADER, SPF_PASS X-Spam-Level: * X-Archive-Number: 200611/281 X-Sequence-Number: 26933 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=hmemailtaglinenov06&FORM=WLMTAG