Re: Problem with aliasing

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: Problem with aliasing
Дата
Msg-id 3E562DA8.2070502@mega-bucks.co.jp
обсуждение исходный текст
Ответ на Problem with aliasing  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Patrick Welche
Дата:
Сообщение: Re: jdbc in OO
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Problem with aliasing