From: Joseph Shraibman <jks@selectacast.net>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: WHERE on an alias
Date: Fri, 24 Aug 2001 14:11:51 -0400
Message-ID: <3B8698E7.4080106@selectacast.net> (raw)
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@selectacast.net
Increase signal to noise ratio. http://www.targabot.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jks@selectacast.net
Subject: Re: WHERE on an alias
In-Reply-To: <3B8698E7.4080106@selectacast.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox