Occupy Stack overflow!
Q&A for anime and manga fans
-- 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