X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 058F556472; Thu, 10 Mar 2005 18:21:27 +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 13334-02; Thu, 10 Mar 2005 18:21:18 +0000 (GMT) Received: from courier.chartwelltechnology.com (ptr-66-225-130-198.ptr.terago.ca [66.225.130.198]) by svr1.postgresql.org (Postfix) with ESMTP id 9575D550EE; Thu, 10 Mar 2005 18:21:16 +0000 (GMT) Received: from [192.168.1.70] ([::ffff:66.225.130.201]) (AUTH: CRAM-MD5 khaleboyes) by courier.chartwelltechnology.com with esmtp; Thu, 10 Mar 2005 11:21:24 -0700 Message-ID: <4230901A.3080101@chartwelltechnology.com> Date: Thu, 10 Mar 2005 11:21:14 -0700 From: Kevin HaleBoyes User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-hackers@postgresql.org, pgsql-bugs@postgresql.org Subject: Re: [HACKERS] We are not following the spec for HAVING without GROUP References: <20050306224713.7FBCAF0C69@svr2.postgresql.org> <4017.1110269233@sss.pgh.pa.us> <8109.1110411647@sss.pgh.pa.us> <10126.1110421296@sss.pgh.pa.us> <16153.1110476690@sss.pgh.pa.us> In-Reply-To: <16153.1110476690@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/93 X-Sequence-Number: 11213 Tom Lane wrote: > Would those of you with access to other DBMSes try this: > > create table tab (col integer); > select 1 from tab having 1=0; > select 1 from tab having 1=1; > insert into tab values(1); > insert into tab values(2); > select 1 from tab having 1=0; > select 1 from tab having 1=1; > > I claim that a SQL-conformant database will return 0, 1, 0, and 1 rows > from the 4 selects --- that is, the contents of tab make no difference > at all. (MySQL returns 0, 0, 0, and 2 rows, so they are definitely > copying our mistake...) > > regards, tom lane From SQL server 2000 with a service pack, I get: zero rows from the first query (having 1=0); one row, col value 1, from second query (having 1=1); ...run inserts... zero rows from the third query (having 1=0); one row, col value 1, from forth query (having 1=1); K.