Re: RFE: Column aliases in WHERE clauses

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: RFE: Column aliases in WHERE clauses
Date: 2012-09-20 06:08:21
Message-ID: CAPTjJmoWQkUvLyby4aD6=yonONQ08tCO8eCNGMpdqi=2NSoVPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 19, 2012 at 11:15 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> I could maybe see something like the following having some value:
>
> SELECT inverse
> FROM data
> WHERE x<>0 AND inverse > .5
> MACRO inverse (1/x)
>

WITH macros AS (SELECT *,1/x AS inverse FROM data) SELECT inverse FROM
macros WHERE x<>0 AND inverse > .5

ChrisA

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carrington, Matthew (Produban) 2012-09-20 06:46:33 pg_upgrade: out of memory
Previous Message Lucas Clemente Vella 2012-09-20 05:47:37 Re: Passing row set into PL/pgSQL function.