Re: Aggregates not allowed in WHERE clause? - Mailing list pgsql-general

From Christopher Browne
Subject Re: Aggregates not allowed in WHERE clause?
Date
Msg-id m34qim4v9m.fsf@knuth.knuth.cbbrowne.com
Whole thread Raw
In response to Aggregates not allowed in WHERE clause?  (Frans <fransgunawan@gmail.com>)
List pgsql-general
A long time ago, in a galaxy far, far away, fransgunawan@gmail.com (Frans) wrote:
> This yields the message: 'Aggregates not allowed in WHERE clause'.
>
> Can somebody help me here....

What it says is right; SQL does not permit using aggregates in the
WHERE clause.

You need to look at the HAVING clause which is, more or less, the
equivalent to WHERE specifically for use with aggregates...
--
(format nil "~S@~S" "cbbrowne" "gmail.com")
http://www.ntlug.org/~cbbrowne/nonrdbms.html
"If  use of  the GPL filters  out people   who are  only interested in
inventing the  worst possible motives  for my  actions then,  yes, I'm
happy to learn that it serves a useful purpose  I'd never thought of."
-- Dave Pearson

pgsql-general by date:

Previous
From: Mickael Remond
Date:
Subject: Re: Insert do not work in my case
Next
From: "Joolz"
Date:
Subject: pl/pgsql oddity