Thread: Column aliases in having or where for Postgres 8.3

Column aliases in having or where for Postgres 8.3

From
Prafulla Tekawade
Date:
Hi,

Anyone knows if I can use column aliases in having condition?
Something like this.
                                                                                                                                  
pgdb=# select sum(c_acctbal) as p from customer having p > 1000;                                                                                                                                           
select sum(c_acctbal) as p from customer having p > 1000;                                                                                                                                                  
ERROR:  column "p" does not exist                                                                                                                                                                          
LINE 1: select sum(c_acctbal) as p from customer having p > 1000;                                                                                                                                          
                                                        ^            

--
Best Regards,
Prafulla V Tekawade