Quantcast
Viewing all articles
Browse latest Browse all 4871

Summing based on a group of values

This seems a bit basic but looking around finding nothing that quite fits. The data is by area of which there are 17 of them. I need a sum for each distinct period of which there are 360. I can get it for one with ease using the code below. To make where it does this for each of the 12 periods in a given for the 30 years in my data is the challenge. Sample data with two months is attached. Any advice would be greatly appreciated.

table schema would be area char(6) and unemp Numeric (9,0) or that is how it is in my database.

Text
select sum(unemp) from dbo.lforce where area in ('000001','000005','000007','000009','000011','000013','000015','000017','000019','000021','000023','000027','000029','000033') and periodyear = '2019' and period = '01 
Text

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>