Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id ED56E9FB738 for ; Thu, 12 Jul 2007 17:36:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 72329-03 for ; Thu, 12 Jul 2007 17:36:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.239]) by postgresql.org (Postfix) with ESMTP id 4B2E69FB629 for ; Thu, 12 Jul 2007 17:36:24 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 68so215153wri for ; Thu, 12 Jul 2007 13:36:19 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:reply-to:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=KtAmdZY/acjKr+mPD126KpdlFhVt+tN6YyaEETEPsuz0MvR2KN1KffZhGo/+6I26Bnz4U6IFTweS476nF6ycIE5AWNfrigHjROv3JsYIbI9yl7vCvnDjKDPRFD9tDRMStkNVugKeq573dZcT3lgVwstou0qnnajne/b0Kfn6ONA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:reply-to:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=d5GDAQUzcDXSI26gInfbHsX/kBSon+497NswDcNBrLH4Y5d6izeNAElPiV9QJBYfGNJPGbOOC1OgSR6Yn5nb0Dop2x5s2iUs35vPaihSyrm5G/L+xGHRiUx4wC+brZ886oSq+b2bcuNcvLufVFxLf0qInZQIN3edKs3CtQmn4Gg= Received: by 10.90.28.13 with SMTP id b13mr1051376agb.1184272579206; Thu, 12 Jul 2007 13:36:19 -0700 (PDT) Received: from ?192.168.3.170? ( [68.79.189.145]) by mx.google.com with ESMTP id 36sm27859322agc.2007.07.12.13.36.15 (version=SSLv3 cipher=RC4-MD5); Thu, 12 Jul 2007 13:36:18 -0700 (PDT) Subject: Re: Converting from MS Access field aliases From: Adam Tauno Williams Reply-To: adamtaunowilliams@gmail.com To: sql pgsql In-Reply-To: <634.1184260980@sss.pgh.pa.us> References: <746273.93291.qm@web54305.mail.re2.yahoo.com> <634.1184260980@sss.pgh.pa.us> Content-Type: text/plain Date: Thu, 12 Jul 2007 16:34:10 -0400 Message-Id: <1184272450.4427.35.camel@aleph.whitemice.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/72 X-Sequence-Number: 28807 On Thu, 2007-07-12 at 13:23 -0400, Tom Lane wrote: > chester c young writes: > >> SELECT field1 / 2 AS foo, > >> field2 * 2 AS bar, > >> foo + bar AS total > >> WHERE foo < 12; > > First, I think it would be great if this worked - like the alias to an > > update table added in 8.2 - saves a lot of typing and makes queries > > much more readable. > This is not an "extension", it is *directly* contrary to both the letter > and spirit of the SQL standard. I can hardly believe that M$ did that > ... oh, actually, I can entirely believe it. The OP has a serious > problem of vendor lockin now, and that's exactly what M$ wants. "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.