field alias in where condition

Поиск
Список
Период
Сортировка
От Havasvölgyi Ottó
Тема field alias in where condition
Дата
Msg-id 000701c56848$7fed4f80$6c00a8c0@OTTO
обсуждение исходный текст
Ответ на PostgreSQL vs. InnoDB performance  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: field alias in where condition  (Richard Huxton <dev@archonet.com>)
Re: field alias in where condition  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,

I issued the following queries:


select substring(proname from 1 to 1) as nevresz, count(*)
from pg_proc
where nevresz = 'a'
order by nevresz
group by nevresz;

select substring(proname from 1 to 1) as nevresz, count(*)
from pg_proc
order by nevresz
group by nevresz;

The first query fails, and says that column 'nevresz' does not exist.
The second is OK.

What is the problem? I cannot use column alias in where condition?

Thanks,
Otto



В списке pgsql-general по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: adding columns with defaults is not implemented
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: PG Lightning Admin running on Linux via WINE 2005524