Joseph,
> playpen=# SELECT a, sum(b) as dsum
> playpen-# FROM taba
> playpen-# GROUP BY a
> playpen-# HAVING dsum > 5;
Sorry, my mistake:
SELECT a, sum(b) as dsum
FROM taba
GROUP BY a
HAVING sum(b) > 5;
I had the impression that aliases for aggregates were allowed in
Postgres HAVING clauses. Apparently not.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete
informationtechnology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small
businesses fax 621-2533 and non-profit organizations. San Francisco