Skip site navigation (1) Skip section navigation (2)

Re: referencing to "computed columns" in where clause

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org, Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Subject: Re: referencing to "computed columns" in where clause
Date: 2008-01-29 17:52:38
Message-ID: 244522.69289.qm@web31814.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-general
--- On Tue, 1/29/08, Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> wrote:

>> other than defining a function such that I can write:

   SELECT ( a-b ) as pippo
     FROM Yourtable
    WHERE ( a-b ) = 7
UNION ALL
   SELECT ( a*b ) as pippo
     FROM Yourtable
    WHERE ( a*b ) < 12
      AND a > 3
UNION ALL
   SELECT ( a+b ) as pippo
     FROM Yourtable
    WHERE ( a+b ) < 12
      AND a < 3;


In response to

pgsql-general by date

Next:From: Tom LaneDate: 2008-01-29 17:53:11
Subject: Re: Table has duplicate keys, what did I do
Previous:From: Ivan Sergio BorgonovoDate: 2008-01-29 17:49:50
Subject: Re: referencing to "computed columns" in where clause

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group