Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id CA67C475E4D for ; Wed, 19 Jun 2002 17:21:00 -0400 (EDT) Received: from mailout04.sul.t-online.com (mailout04.sul.t-online.com [194.25.134.18]) by postgresql.org (Postfix) with ESMTP id 41E79475A66 for ; Wed, 19 Jun 2002 17:13:47 -0400 (EDT) Received: from fwd08.sul.t-online.de by mailout04.sul.t-online.com with smtp id 17Kmlq-0003AZ-0F; Wed, 19 Jun 2002 23:13:42 +0200 Received: from avocado.shifted-bytes.de (520056191158-0001@[217.224.248.60]) by fmrl08.sul.t-online.com with esmtp id 17Kmlj-2IrBJ2C; Wed, 19 Jun 2002 23:13:35 +0200 Received: from shifted-bytes.de (orange.shifted-bytes.de [10.0.0.14]) by avocado.shifted-bytes.de (8.12.2/8.12.2) with ESMTP id g5JLDYmI002707; Wed, 19 Jun 2002 23:13:34 +0200 (CEST) Message-ID: <3D10F3FB.6090706@shifted-bytes.de> Date: Wed, 19 Jun 2002 23:13:31 +0200 From: Michael Agbaglo User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: Wei Weng Cc: pgsql-sql@postgresql.org Subject: Re: syntax for access an alias in the where clause ? References: <3D10C770.7040100@shifted-bytes.de> <1024516580.20296.8.camel@Monet> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Sender: 520056191158-0001@t-dialin.net X-Archive-Number: 200206/258 X-Sequence-Number: 8223 Wei Weng wrote: > Is it allowed to use spaces in postgresql alias? > > Why dont you try to use alias1 instead of "alias 1"? really amusing... muhahaha... I don't use the brackets either... I didn't assume that you might be interested in how the expression looks like or what aliases I'm using... > > > On Wed, 2002-06-19 at 14:03, Michael Agbaglo wrote: > >>Hi ! >> >>It's long ago since I used SQL :-) >> >>select [expression 1] as [alias 1], [expression 2] as [alias 2] >>where [alias 1] < [alias 2] >>order by [alias 2] - [alias 1] >> >>---> ERROR: Attribute '[alias 1]' not found >> >>I found a lot of 'select [expression] as' but I've never seen somebody >>accessing the alias ... Can't this be done ? >> >>M. >> >> >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >> >>