Percentage of posts from the top 1 percent of posters

0

Please login or register to vote for this query.

(click on this box to dismiss)

Biology Meta

Q&A about the site for biology researchers, academics, and students

-- Total Users
-- A specific number of users
declare @allPosts decimal(15,5) 
SELECT @allPosts = cast(COUNT(*) as decimal(15,5) ) FROM posts

SELECT  CAST(SUM(k) as decimal (15,5)) / @allPosts * 100
FROM (
SELECT TOP 10 PERCENT OwnerUserID , count(id) k
FROM Posts p
WHERE OwnerUserID > 0
GROUP BY OwnerUserID
ORDER BY count(id) desc ) T

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results