Re: [GENERAL] HAVING QUESTION

From: Bob Kline <bkline(at)rksystems(dot)com>
To: Alexander Barkov <bar(at)izhcom(dot)ru>
Cc: "'pgsql-general(at)hub(dot)org'" <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] HAVING QUESTION
Date: 1999-11-03 15:08:17
Message-ID: Pine.LNX.4.10.9911031007150.8497-100000@rksystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)rksystems(dot)com
http://www.rksystems.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Barkov 1999-11-03 15:19:24 HAVING QUESTION
Previous Message Natalya S. Makushina 1999-11-03 13:45:08 Problem: pq_recvbuf: unexpected EOF of client connection