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 17C583A5652 for ; Thu, 2 Dec 2004 02:21:34 +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 51432-10 for ; Thu, 2 Dec 2004 02:21:28 +0000 (GMT) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id 24F463A564B for ; Thu, 2 Dec 2004 02:21:29 +0000 (GMT) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id iB22LVZ25314 for ; Thu, 2 Dec 2004 11:21:31 +0900 Message-ID: <001601c4d815$d8f03430$7201a8c0@mst1x5r347kymb> From: "Iain" To: Subject: invalid 'having' clause Date: Thu, 2 Dec 2004 11:22:56 +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/17 X-Sequence-Number: 19637 Hi, 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 This isn't valid in pg (7.4.6), but this is: select count(*) from sometable group by somecolumn having count(*) > 1 Does anyone have any idea? I can't remember what other databases do, and I'm not so familiar with the standards, but I just thought I'd mention it anyway. regards Iain