Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DF75C9FB48D for ; Thu, 12 Jul 2007 13:36:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 92016-09 for ; Thu, 12 Jul 2007 13:36:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web54305.mail.re2.yahoo.com (web54305.mail.re2.yahoo.com [206.190.49.115]) by postgresql.org (Postfix) with SMTP id 3B5229FB410 for ; Thu, 12 Jul 2007 13:36:55 -0300 (ADT) Received: (qmail 94648 invoked by uid 60001); 12 Jul 2007 16:36:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=QEoGICGOwXcYwd3JvODR/IjaJ6pJLYkUfGi2YtLAug+DK9j/29diaakWqR0I7N2OZVFhwHUkPG1PwjlzfxNLh4aCH0mGhj6UZmKOyU5F7OCu/00K4KPeq4Lwcp2VMTwcr097ggx08ZNJj3DMww1SjZs+2ZF8RYt4NyI+i1qibIc=; X-YMail-OSG: uFpsYKoVM1k7lTk17G8_Rwci3zHYBRiEuaus9nmt4hS7pYiWNvB5MYewue3jmlL1AcMYIoCoFbpR9V0Pt9M473V6CQzhN6AZMccS79fOb_Dqb39JDLsV1fDnwGGo2w-- Received: from [75.41.74.118] by web54305.mail.re2.yahoo.com via HTTP; Thu, 12 Jul 2007 09:36:50 PDT Date: Thu, 12 Jul 2007 09:36:50 -0700 (PDT) From: chester c young Subject: Re: Converting from MS Access field aliases To: Joel Richard Cc: sql pgsql In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <746273.93291.qm@web54305.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/67 X-Sequence-Number: 28802 > SELECT field1 / 2 AS foo, > field2 * 2 AS bar, > foo + bar AS total > WHERE foo < 12; > > The first two fields are fine, it's the third that's a problem. The > database reports > > ERROR: column "foo" does not exist > 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. Second, only way I see is to set this on top of a view generating your foo and bar aliases, and go from there. Compared to rewriting the expression each time, it has the advantages of better syntax in the end and might yield better performance as well. ____________________________________________________________________________________ Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz