WHERE on an alias

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: WHERE on an alias
Date: 2001-08-24 18:11:51
Message-ID: 3B8698E7.4080106@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

playpen=# select a, sum(b) as dsum from taba where dsum > 5 group by(a);
ERROR: Attribute 'dsum' not found

Why can we GROUP BY on an alias but not do a WHERE on an alias? I have a subselect that
explain shows is being run twice if I have to put it in the WHERE clause.

--
Joseph Shraibman
jks(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-08-24 19:27:30 Re: WHERE on an alias
Previous Message Vivek Khera 2001-08-24 15:39:55 Re: DBD::Pg install error (freebsd)