Re: WHERE on an alias

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: WHERE on an alias
Date: 2001-08-24 20:43:21
Message-ID: web-108012@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-08-24 20:52:49 Re: WHERE on an alias
Previous Message Joseph Shraibman 2001-08-24 20:18:50 Re: WHERE on an alias