Re: [HACKERS] We are not following the spec for HAVING without GROUP

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [HACKERS] We are not following the spec for HAVING without GROUP
Date: 2005-03-10 21:37:13
Message-ID: 4230BE09.9070305@coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mark Shewmaker 2005-03-10 22:42:07 Re: [HACKERS] We are not following the spec for HAVING without GROUP BY
Previous Message Jaime Casanova 2005-03-10 20:14:23 Re: We are not following the spec for HAVING without GROUP BY

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Shewmaker 2005-03-10 22:42:07 Re: [HACKERS] We are not following the spec for HAVING without GROUP BY
Previous Message Jaime Casanova 2005-03-10 21:28:06 Re: Raw size