Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sum rows with same weeknumber

Author  Topic 

GeirA
Starting Member

2 Posts

Posted - 2012-05-03 : 01:38:58
I have this query:



And I would like to sum the rows with the same weeknumber.

I have tried a combination of distinct and sum, but with no luck.

nathans
Aged Yak Warrior

938 Posts

Posted - 2012-05-03 : 02:04:17
Use GROUP BY with SUM.


select rwweek, sum(grosswool)
from ...
where ...
group by rwweek
order by rweek
Go to Top of Page

GeirA
Starting Member

2 Posts

Posted - 2012-05-03 : 03:14:31
Thanks a lot!
Go to Top of Page
   

- Advertisement -