HAVING QUESTION - Mailing list pgsql-general

From Alexander Barkov
Subject HAVING QUESTION
Date
Msg-id 3820527C.D537736D@izhcom.ru
Whole thread Raw
In response to Problem: pq_recvbuf: unexpected EOF of client connection  ("Natalya S. Makushina" <mak@rtsoft.msk.ru>)
Responses Re: [GENERAL] HAVING QUESTION
Re: [GENERAL] HAVING QUESTION
List pgsql-general
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?


Thanks.


--
Alexander Barkov
IZHCOM, Izhevsk
email:    bar@izhcom.ru      | http://www.izhcom.ru
Phone:    +7 (3412) 51-55-45 | Fax: +7 (3412) 78-70-10
ICQ:      7748759

pgsql-general by date:

Previous
From: "Stiaan"
Date:
Subject: Installing Postgresql
Next
From: Scott Perkins
Date:
Subject: Club/Assoc/Roster Mgt App