On Wed, 6 Oct 1999, Bruce Momjian wrote:
> > Thanks bruce and hermit for all the comments,
> > I looked into the book "The SQL Standard" fourth edition of Date
> > and in the appendixes page 439 they have an example which they
> > discuss. The example is: select count(*) as x from mt having 0 = 0;
> > with an empty table they say logically correct it should return one
> > column and no rows but sql gives a table of one column and one
> > row. So I think it's true that HAVING has to have an aggregation
> > but it will also be possible use a non-aggregation.
> >
> > If I look in our crash-me output page (this is a handy thing for this
> > kind of questions) and look for all the other db's to see what they
> > do I can say the following thing:
> > Informix,Access,Adabas,db2,empress,ms-sql,oracle,solid and
> > sybase are all supporting non-aggregation in having clause.
> > At this moment everyone except postgres is supporting it.
> >
> > The change which I can made is to remove the if structure around
> > the having tests so that having with group functions will also be
> > tested in the crash-me test.
> >
> > I will try the patch of bruce for the comment part. It shouldn't be the
> > way that the perl module is stripping the comments of the querie
> > but it is possible and if it is possible it will be a bug in the DBD
> > postgresql perl module.
>
> Maybe we should support the HAVING without aggregates. What do others
> think?
If we are the only one that doesn't, it just makes it harder for those
moving from Oracle/Informix/etc if they happen to be using such queries...
How hard would it be to implement?
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org