Why is "group by" obligatory in SQL?
From: Hans Mayr <mayr1972_at_gmx.de>
Date: Thu, 23 Jul 2009 02:46:07 -0700 (PDT)
Message-ID: <340ae2ba-d78e-4a74-9da6-8b7396885bcb_at_w41g2000yqb.googlegroups.com>
Hello,
Date: Thu, 23 Jul 2009 02:46:07 -0700 (PDT)
Message-ID: <340ae2ba-d78e-4a74-9da6-8b7396885bcb_at_w41g2000yqb.googlegroups.com>
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;"? What additional value is generated by "group by a_field"?
Thanks and best,
Hans Received on Thu Jul 23 2009 - 11:46:07 CEST