X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 537453A58F0 for ; Thu, 2 Dec 2004 20:02:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84279-03 for ; Thu, 2 Dec 2004 20:02:47 +0000 (GMT) Received: from www.postgresql.com (unknown [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id B989A3A5921 for ; Thu, 2 Dec 2004 20:01:44 +0000 (GMT) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by www.postgresql.com (Postfix) with ESMTP id CF52473B0C2 for ; Thu, 2 Dec 2004 07:48:54 +0000 (GMT) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id iB27jeZ26650; Thu, 2 Dec 2004 16:45:40 +0900 Message-ID: <000e01c4d843$07a83890$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Tom Lane" Cc: References: <001601c4d815$d8f03430$7201a8c0@mst1x5r347kymb> <1697.1101956079@sss.pgh.pa.us> Subject: Re: invalid 'having' clause Date: Thu, 2 Dec 2004 16:46:22 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/24 X-Sequence-Number: 19644 OK, thanks. That seems to make sense. regards Iain ----- Original Message ----- From: "Tom Lane" To: "Iain" Cc: Sent: Thursday, December 02, 2004 11:54 AM Subject: Re: [SQL] invalid 'having' clause > "Iain" 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