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

From Tom Lane
Subject Re: We are not following the spec for HAVING without GROUP
Date
Msg-id 11032.1110429895@sss.pgh.pa.us
Whole thread Raw
In response to Re: We are not following the spec for HAVING without GROUP  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>>> Comments?  Can anyone confirm whether DB2 or other databases allow
>>> ungrouped column references with HAVING?

> MySQL allows it:

A slightly tighter experiment shows that they treat HAVING like WHERE
in this case:

mysql> create table tab(col int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into tab values(1);
Query OK, 1 row affected (0.00 sec)

mysql> insert into tab values(2);
Query OK, 1 row affected (0.01 sec)

mysql> select col from tab having col>1;
+------+
| col  |
+------+
|    2 |
+------+
1 row in set (0.00 sec)

I think it's fairly likely that they copied our misinterpretation ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: pgpool question
Next
From: Tom Lane
Date:
Subject: Re: We are not following the spec for HAVING without GROUP BY