Re: Problem with aliasing - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject Re: Problem with aliasing
Date
Msg-id 3E562DA8.2070502@mega-bucks.co.jp
Whole thread Raw
In response to Problem with aliasing  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
Greg Stark wrote:
>
> Try either of:
>
>   SELECT max(req1, req2, req3) AS max FROM invoices WHERE max(req1, req2, req3) <= now()

Ok, that works. But why can't I alias the result of the max() function
and use the alias in the where clause? Something like:

SELECT max(r1,r2,r3) as max from invoices WHERE max <= now();

Why can't postgres see the alias when inside the WHERE clause?

Jc


pgsql-general by date:

Previous
From: Patrick Welche
Date:
Subject: Re: jdbc in OO
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: Problem with aliasing