Re: invalid 'having' clause - Mailing list pgsql-sql

From Iain
Subject Re: invalid 'having' clause
Date
Msg-id 000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb
Whole thread Raw
In response to invalid 'having' clause  ("Iain" <iain@mst.co.jp>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Tomasz Myrta
Date:
Subject: Re: order by problem
Next
From: Richard Huxton
Date:
Subject: Re: SET AUTOCOMMIT TO OFF