Suppose I have a table with a numeric column (lets call it \"score\").
I\'d like to generate a table of counts, that shows how many times scores appeared in each ran
I would do this a little differently so that it scales without having to define every case:
select t.range as [score range], count(*) as [number of occurences] from ( select FLOOR(score/10) as range from scores) t group by t.range
Not tested, but you get the idea...