On Thu, 2005-09-29 at 14:08, Axel Rau wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Exactly, that query works as I expected. Thank you.
> Can you answer this question as well:
> > Looking for a workaround, I learned that aggregate functions are not
> > allowed in WHERE clauses.
> > Question: Is this conform with the standard?
The problem is that where clauses "fire" before group by does, so the
aggregate doesn't exist yet when the where clause would be doing it's
selection.
Which is why the spec, and postgresql, have the "having" clause...
See this part of the docs:
http://www.postgresql.org/docs/8.0/interactive/sql-select.html