HAVING QUESTION

From: Alexander Barkov <bar(at)izhcom(dot)ru>
To: "'pgsql-general(at)hub(dot)org'" <pgsql-general(at)hub(dot)org>
Subject: HAVING QUESTION
Date: 1999-11-03 15:19:24
Message-ID: 3820527C.D537736D@izhcom.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)izhcom(dot)ru | http://www.izhcom.ru
Phone: +7 (3412) 51-55-45 | Fax: +7 (3412) 78-70-10
ICQ: 7748759

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Perkins 1999-11-03 15:36:36 Club/Assoc/Roster Mgt App
Previous Message Bob Kline 1999-11-03 15:08:17 Re: [GENERAL] HAVING QUESTION