with scores as (select month, location, score6=case when score < 7 then 1 else 0 end, score79=case when score > 6 and score < 9 then 1 else 0 end, score9=case when score > 9 then 1 else 0 end from table)
select month, location, score6=sum(score6) over (partition by month,location),score79=sum(score79) over (partition by month,location),score9=sum(score9) over (partition by month,location)
from scores