How many upvotes are there on your site?
Q&A for users of TeX, LaTeX, ConTeXt, and related typesetting systems
-- Answer upvote distribution
-- How many upvotes are there on your site?
declare @VoteStats table (PostId int, up int)
select up, count(*)
select PostId, count(*) as up
where VoteTypeId = 2
group by PostId
group by up
order by up;