From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
---|---|
To: | Alban Hertroys <alban(at)magproductions(dot)nl> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: NOT HAVING clause? |
Date: | 2006-01-24 15:28:21 |
Message-ID: | 20060124072516.B27682@megazone.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, 24 Jan 2006, Alban Hertroys wrote:
> This is sort of a feature request, I suppose. I solved my problem, but
> "NOT HAVING" seems to match better with the desired result or the way
> you phrase the question in your mind, if that makes any sense...
One problem is that HAVING really works on entire groups at a time
(including aggregated data for the group) not on pieces of the group.
However, I think one might be able to fake it with an array accumulating
aggregate like the one from
http://www.postgresql.org/docs/current/static/xaggr.html
and a query like:
SELECT object_id FROM image GROUP BY object_id HAVING
NOT(1 = ANY(array_accum(sort_order))).
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-01-24 15:30:32 | Re: user defined function |
Previous Message | Dave Page | 2006-01-24 15:27:57 | Re: Does this look ethical to you? |