http://qs321.pair.com?node_id=602600


in reply to (somewhat OT) Seeking a SQL counter-example

IDSalesIDCityIDMoney
110201000
210222000
311204000
411228000
510203000
610225000
711207000
811229000
select from table SalesID,CityID,Sum(Money) Groupby SalesID,CityID -- or select from table SalesID,CityID,Sum(Money) Groupby CityID, SalesID

Those should vary only in output order of the summed rows. The danger of automatic grouping is when/if someone picks "ID" in the select list... then it all goes to heck. The "common case" for Group By is to list all columns not aggregated in the select_column clause. Automatically forcing group-by seems to be almost assuredly doomed to run into keys and foreign-keys when they are incorrectly added to the columns list.

In your limited case, tho, I'm thinking you're safe.

--
$you = new YOU;
honk() if $you->love(perl)