instruction: How Rich Are The 1%?. Occupy Stack overflow!
response: 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