Re: division by zero issue - Mailing list pgsql-general

From Chester Kustarz
Subject Re: division by zero issue
Date
Msg-id Pine.BSO.4.44.0409151532080.26903-100000@detroit.arbor.net
Whole thread Raw
In response to Re: division by zero issue  (David Fetter <david@fetter.org>)
List pgsql-general
On Wed, 15 Sep 2004, David Fetter wrote:
> I know it's a little weird to have WHERE for non-aggregate and HAVING
> for aggregates, but that's the SQL standard...

the WHERE clause strips rows before grouping. the HAVING clause operates
after grouping. so it's not so much aggregate vs. non-aggregate as it is
about order of operations.

http://philip.greenspun.com/sql/complex-queries.html

"The WHERE clause restricts which rows are returned. The HAVING clause operates analogously but on groups of rows."


pgsql-general by date:

Previous
From: Chester Kustarz
Date:
Subject: Re: division by zero issue
Next
From: "Anony Mous"
Date:
Subject: psql error - "unrecognizable command" V8.0.0 beta