pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Iain <iain@mst.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: invalid 'having' clause
Date: Thu, 2 Dec 2004 16:46:22 +0900
Message-ID: <000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb> (raw)
References: <001601c4d815$d8f03430$7201a8c0@mst1x5r347kymb>
	<1697.1101956079@sss.pgh.pa.us>

OK, thanks. That seems to make sense.

regards
Iain
----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Iain" <iain@mst.co.jp>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, December 02, 2004 11:54 AM
Subject: Re: [SQL] invalid 'having' clause 


> "Iain" <iain@mst.co.jp> writes:
>> Just a quick question out of curiosity, I was just wondering if this is 
>> supposed to be valid sql:
> 
>> select count(*) as cnt
>> from sometable
>> group by somecolumn
>> having cnt > 1
> 
> No.  The HAVING clause logically executes before the SELECT output list
> does, so it makes no sense for it to refer to the output list entries.
> 
> regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org



view thread (3+ messages)

Message-ID: <000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb>
Permalink:  ../000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb/
Also on:    postgresql.org/message-id/000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb

 · 

reply

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: iain@mst.co.jp, tgl@sss.pgh.pa.us
  Subject: Re: invalid 'having' clause
  In-Reply-To: <000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb>

* 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