Re: Why using "Group By"

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Tue, 18 Mar 2003 05:16:38 GMT
Message-ID: <3E76AC18.3010600_at_earthlink.net>


Mikito Harakiri wrote:
> "oferbu" <junkbu_at_hotmail.com> wrote:

>>So if I sum all the replies by now, there is no really any need for
>>the extra information added by the clause "Group by YYY, ZZZ" when the
>>SQL already contains an aggregate function, right?

>
> Correct: nobody, suggested a reason convincing enough to justify "group by".
> Even in complicated examples like this

IIRC, didn't Chris Date have a sequence of articles with the heading GBH - Grievous Bodily Harm - in DBP&D in the last months of his "According to Date" series. The thesis was roughly that both GROUP BY and HAVING (the GB and H in GH) were unnecessary, even harmful.

> and, therefore, "group by" is redundant.

I believe that this is correct - except that standard SQL requires it.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Received on Tue Mar 18 2003 - 06:16:38 CET

Original text of this message