Re: Why is "group by" obligatory in SQL?

From: toby <toby_at_telegraphics.com.au>
Date: Mon, 27 Jul 2009 15:04:08 -0700 (PDT)
Message-ID: <bfcfe22c-aebb-41b3-8fa3-4158b1d2c26b_at_n2g2000vba.googlegroups.com>


On Jul 23, 5:46 am, Hans Mayr <mayr1..._at_gmx.de> wrote:
> Hello,
>
> I still don't know if there is a better group to post general
> questions about SQL and the background. So I hope nobody minds ;-)
>
> My question is: Why do you have to state the GROUP BY explicitly in
> SQL? Why isn't it enough to write "select a_field, sum(b_field) from
> c_table;"?

This is a valid aggregate: over all rows.

> What additional value is generated by "group by a_field"?

That is a different case, obviously.

> Thanks and best,
>
> Hans
Received on Tue Jul 28 2009 - 00:04:08 CEST

Original text of this message