Re: We are not following the spec for HAVING without GROUP - Mailing list pgsql-hackers

From Mark Kirkwood
Subject Re: We are not following the spec for HAVING without GROUP
Date
Msg-id 4230BE09.9070305@coretech.co.nz
Whole thread Raw
In response to Re: We are not following the spec for HAVING without GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: We are not following the spec for HAVING without GROUP  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
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...)

Firebird 1.5.1 FreeBSD 5.3
Database:  test
SQL> drop table tab;
SQL> create table tab (col integer);
SQL> select 1 from tab having 1=0;
SQL> select 1 from tab having 1=1;


============
           1

SQL> insert into tab values(1);
SQL> insert into tab values(2);
SQL> select 1 from tab having 1=0;
SQL> select 1 from tab having 1=1;


============
           1

SQL>



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Raw size
Next
From: Nicolai Tufar
Date:
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests