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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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