Re: Why using "Group By"

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 13 Mar 2003 12:05:00 -0500
Message-ID: <Fk3ca.60$dA2.7559277_at_mantis.golden.net>


"Damjan S. VujnoviÄ?" <damjan_at_NO_SPAM.galeb.etf.bg.ac.yu> wrote in message news:b4prme$fnl$1_at_news.etf.bg.ac.yu...
> oferbu wrote:

> > This is a theoretical question. Why do I need to add the "Group By" in
> > the following SQL:
> >
> > SELECT
> > CUSTOMER_CITY, COUNT(*)
> > FROM
> > CUSTOMER_TABLE
> >
> > Isn't it clear that I want to get the number of rows per city, so why
> > is it necessary to add:
> >
> > GROUP BY
> > CUSTOMER_CITY
>
> How will you write (using your sintax) something like this:
>
> SELECT
> CUSTOMER_CITY, COUNT(*)
> FROM
> CUSTOMER_TABLE
> GROUP BY
> CUSTOMER_CITY, SOME_OTHER_CUSTOMER_TABLE_ATTRIBUTE
Why would anyone want to destroy logical identity? Received on Thu Mar 13 2003 - 18:05:00 CET

Original text of this message