Q&A for scientific skepticism
declare @closetype as table (ID int, closeType varchar(100)) Insert into @closetype values (1, 'Exact Duplicate'), (2, 'Off-topic'), (3, 'Subjective and argumentative'), (4, 'Not a real question'), (7, 'Too localized'), (10, 'General reference'), (20, 'Noise or pointless') SELECT closeType, count(ph.id) k FROM PostHistory ph INNER JOIN @closeType ct ON ph.comment = ct.id WHERE PostHistoryTypeId = 10 GROUP BY Closetype