Search Postgresql Archives

field alias in where condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux