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
declare @RangeWidth int set @RangeWidth = 10 select Floor(Score/@RangeWidth) as LowerBound, Floor(Score/@RangeWidth)+@RangeWidth as UpperBound, Count(*) From ScoreTable group by Floor(Score/@RangeWidth)