Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CE2B69FB9F7 for ; Thu, 12 Jul 2007 19:00:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 58702-09 for ; Thu, 12 Jul 2007 19:00:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.194]) by postgresql.org (Postfix) with ESMTP id 51A2A9FB9AA for ; Thu, 12 Jul 2007 19:00:29 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1I96hy-0001WS-BP; Thu, 12 Jul 2007 23:00:22 +0100 From: Gregory Stark To: Cc: "sql pgsql" Subject: Re: Converting from MS Access field aliases In-Reply-To: <1184272450.4427.35.camel@aleph.whitemice.org> (Adam Tauno Williams's message of "Thu, 12 Jul 2007 16:34:10 -0400") Organization: EnterpriseDB References: <746273.93291.qm@web54305.mail.re2.yahoo.com> <634.1184260980@sss.pgh.pa.us> <1184272450.4427.35.camel@aleph.whitemice.org> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.sql" 574) Date: Thu, 12 Jul 2007 23:00:22 +0100 Message-ID: <878x9l705l.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/74 X-Sequence-Number: 28809 "Adam Tauno Williams" writes: > "AS" works in Informix, and I believe, in DB2 as well. So it is at > least pretty common; I'm not saying it is correct. Since Informix > predates M$-SQL they at least didn't invent it. AS works in Postgres too. But the defined aliases are only in the resulting output columns, not in scope for the where clause. In fact the expressions used aren't even evaluated for rows which don't match the where clause which is pretty important if those expressions are subqueries or volatile functions. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com