From: Tom Lane <tgl@sss.pgh.pa.us>
To: kaiq@realtyideas.com
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] having with sub select?
Date: Wed, 15 Dec 1999 18:33:55 -0500
Message-ID: <19712.945300835@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.10.9912151727010.7112-100000@picasso.realtyideas.com>
<kaiq@realtyideas.com> writes:
> select rep, sum(amount)
> from orders
> group by rep
> having sum(amount) < (select quota from salesreps where empl_num = rep);
> for the query, I got (I'm using 6.5.1):
> ERROR: Illegal use of aggregates or non-group column in HAVING clause
Seems to work OK in 6.5.3 and in current development sources ... I'm not
quite sure why it fails in 6.5.1 and not in 6.5.3, because I can't find
any indication that parse_aggs.c changed in between. But please update
and see if you still have the problem.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, kaiq@realtyideas.com
Subject: Re: [SQL] having with sub select?
In-Reply-To: <19712.945300835@sss.pgh.pa.us>
References: <Pine.LNX.4.10.9912151727010.7112-100000@picasso.realtyideas.com> <19712.945300835@sss.pgh.pa.us>
* 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