I can't eloquently explain my end problem, feel free to edit both this title and content of this question if you can describe the SQL solution better.
I have data in a table containing the columns "Item", "Category", and I have the following query calculating the number of distinct categories within each item.
[ItemID], COUNT(DISTINCT [CategoryText] ) AS 'number of categories'
`ItemID', 'number of categories'
'Number of categories', 'Number of items'
Aggregate the results by number of categories.
select [number of categories], count(*) [number of items] from (SELECT [ItemID], COUNT(DISTINCT [CategoryText]) AS 'number of categories' FROM [SampleTable] GROUP BY ItemID) t group by [number of categories]