X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id BAEE9310494 for ; Sat, 28 Jun 2003 05:46:00 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 27001-01 for ; Sat, 28 Jun 2003 02:45:49 -0300 (ADT) Received: from web80503.mail.yahoo.com (web80503.mail.yahoo.com [66.218.79.73]) by svr1.postgresql.org (Postfix) with SMTP id 8898531047C for ; Sat, 28 Jun 2003 02:45:48 -0300 (ADT) Message-ID: <20030628054547.40824.qmail@web80503.mail.yahoo.com> Received: from [203.131.94.141] by web80503.mail.yahoo.com via HTTP; Fri, 27 Jun 2003 22:45:47 PDT Date: Fri, 27 Jun 2003 22:45:47 -0700 (PDT) From: Ludwig Lim Subject: Question on OUTER JOINS. To: PostgreSQL Mailing List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=BAYES_10, RCVD_IN_DSBL, RCVD_IN_NJABL X-Spam-Level: X-Archive-Number: 200306/325 X-Sequence-Number: 14083 Hi: 1) Is the ON clause of an OUTER JOIN always evaluated first before the WHERE clause? 2) Given the ff SQL statement : SELECT employee_id, a.status as status FROM permissions a LEFT JOIN (select * from employee where employee_id = 3) as b on (a.status=b.status) WHERE a.status='test'; Is there a way to rewrite the query as a view such that one can do: select * from test_view where employee_id=3 and status='test'; Thank you very much, ludwig lim __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com