Skip site navigation (1) Skip section navigation (2)

Re: invalid 'having' clause

From: "Iain" <iain(at)mst(dot)co(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: invalid 'having' clause
Date: 2004-12-02 07:46:22
Message-ID: 000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb (view raw or flat)
Thread:
Lists: pgsql-sql
OK, thanks. That seems to make sense.

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


> "Iain" <iain(at)mst(dot)co(dot)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(at)postgresql(dot)org

In response to

pgsql-sql by date

Next:From: Richard HuxtonDate: 2004-12-02 08:56:21
Subject: Re: SET AUTOCOMMIT TO OFF
Previous:From: Tomasz MyrtaDate: 2004-12-02 07:18:03
Subject: Re: order by problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group