Home > Archive > microsoft.public.sqlserver.server > August 2002 > GROUP BY DOES NOT AGGREGATE





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author GROUP BY DOES NOT AGGREGATE
martin croft

2002-08-15, 4:23 am

Couple of things i noticed, you had signeddata in your
group by this is not required as thats what your aggregrate
is, also if your grouping by that selection the order by
probably not required below is a simple aggregate using
northwind, check out the differnt results between A & B

A)
select customerID, sum(Freight),Shipcity from
northwind.dbo.orders
group by customerID, Shipcity


B)

select customerID, sum(Freight),Shipcity from
northwind.dbo.orders
group by customerID, Shipcity,Freight


Hope i got the gist of what you were trying to do
>-----Original Message-----
>Hello There,
>
>I am writing a group by statement, but the rows seem not
>to agrreagate.
>
>the sql i have is the following:
>select account, category, timeid, entity, sum(signeddata)
>as signeddata, source, channel, func,organization, type
>from dbo.fcst_sum
>group by account, category, timeid, entity, signeddata,
>source, channel, func,organization, type
>order by account, category, timeid, entity, signeddata,
>source, channel, func,organization, type
>
>and the results of this query is attached in the excel
>sheet with this post. It should give just one row with

the
>column "Signeddata" aggregated.
>
>Any ideas why this group by is not working.
>
>Thank you very much for your help.
>
>martino
>
>

Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net