On Wed, 3 Nov 1999, Alexander Barkov wrote:
>
> Hi!
>
>
> How can I refer the calculated field in HAVING clause.
>
> This work in MySQL:
>
> SELECT some_expression as field1, ...
> FROM tablename
> GROUP BY ...
> HAVING field1>0;
>
> PostgreSQL gives error "Attribute 'field1' not found".
>
>
> Are there any workarounds?
>
>
How about HAVING some_expression > 0? (Thought your version is legal
SQL, I believe).
--
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com