I know this is resolved, still....just a suggetion use a look up table or create another cte for all grades.

Then join this look up table with your main cte (or table) where score in main table is between score range in the grade lookup. this will give you more felxibility.

with sample as (

select 6 as Items,0 as score union all select 2 as Items,30 as score union all select 10 as Items,50 as score union all select 12 as Items,75 as score ),LkpGrade as ( select 'Grade1' as Grade,0 as MinScore, 39 as MaxScore union all select 'Grade2' as Grade,40 as MinScore, 69 as MaxScore union all select 'Grade3' as Grade,70 as MinScore, 100 as MaxScore ) select g.Grade, sum(s.Items) from sample s inner join LkpGrade g on s.score between g.MinScore and g.MaxScore group by g.Grade;