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

Lists: pgsql-bugspgsql-hackers
From: "Zeugswetter Andreas DAZ SD" <ZeugswetterA(at)spardat(dot)at>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <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 BY
Date: 2005-03-10 09:17:50
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA40184D339@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


> What that means is that neither the HAVING clause nor the targetlist
> can use any ungrouped columns except within aggregate calls; that is,
>
> select col from tab having 2>1

Informix:
select tabname from systables having 2 > 1;
294: The column (tabname) must be in the GROUP BY list.
select tabname from systables group by 1 having 2 > 1;
all rows returned
select tabname from systables group by 1 having 1 > 2;
no rows found

Andreas