Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 26E4B475C8E for ; Wed, 19 Jun 2002 16:22:07 -0400 (EDT) Received: from mta5.snet.net (mta5.snet.net [204.60.203.77]) by postgresql.org (Postfix) with ESMTP id B8F48476D6B for ; Wed, 19 Jun 2002 15:56:20 -0400 (EDT) Received: from pop.snet.net (pop.snet.net [204.60.203.72]) by mta5.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g5JJrdW7022815; Wed, 19 Jun 2002 15:53:39 -0400 (EDT) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from [192.168.1.83] (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g5JJuHkY023356; Wed, 19 Jun 2002 15:56:18 -0400 (EDT) Subject: Re: syntax for access an alias in the where clause ? From: Wei Weng To: Michael Agbaglo Cc: pgsql-sql@postgresql.org In-Reply-To: <3D10C770.7040100@shifted-bytes.de> References: <3D10C770.7040100@shifted-bytes.de> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 (1.0.5-4) Date: 19 Jun 2002 15:56:19 -0400 Message-Id: <1024516580.20296.8.camel@Monet> Mime-Version: 1.0 X-Archive-Number: 200206/255 X-Sequence-Number: 8220 Is it allowed to use spaces in postgresql alias? Why dont you try to use alias1 instead of "alias 1"? 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 > -- Wei Weng Network Software Engineer KenCast Inc.