Re: Selecting count of details along with details columns - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Selecting count of details along with details columns
Date
Msg-id 1128022197.29347.56.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: Selecting count of details along with details columns  (Axel Rau <Axel.Rau@Chaos1.DE>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Axel Rau
Date:
Subject: Re: Selecting count of details along with details columns
Next
From: "Ricky Sutanto"
Date:
Subject: unsubscribe