playpen=# select a, sum(b) as dsum from taba where dsum > 5 group by(a);
ERROR:  Attribute 'dsum' not found

Why can we GROUP BY on an alias but not do a WHERE on an alias?  I have a subselect 
that 
explain shows is being run twice if I have to put it in the WHERE clause.

-- 
Joseph Shraibman
[EMAIL PROTECTED]
Increase signal to noise ratio.  http://www.targabot.com


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to