field alias in where condition - Mailing list pgsql-general

From Havasvölgyi Ottó
Subject field alias in where condition
Date
Msg-id 000701c56848$7fed4f80$6c00a8c0@OTTO
Whole thread Raw
In response to PostgreSQL vs. InnoDB performance  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: field alias in where condition
Re: field alias in where condition
List 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 by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: adding columns with defaults is not implemented
Next
From: Alvaro Herrera
Date:
Subject: Re: PG Lightning Admin running on Linux via WINE 2005524