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
Try
SELECT (str(range) + "-" + str(range + 9) ) AS [Score range], COUNT(score) AS [number of occurances] FROM (SELECT score, int(score / 10 ) * 10 AS range FROM scoredata ) GROUP BY range;