How Rich Are The 1%?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Occupy Stack overflow!

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Enter Query Title
-- Enter Query Description

;WITH percentile AS (
SELECT NTILE(100) OVER (ORDER BY Reputation DESC) as p, Reputation, DisplayName
FROM Users
)
SELECT 'The ' + CASE p WHEN 1 THEN '1' ELSE '99' END + '%' AS Who, SUM(Reputation) AS Rep 
FROM percentile
GROUP BY CASE p WHEN 1 THEN '1' ELSE '99' END

Enter Parameters

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