Rank and Percentile

1

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

WITH Rankings AS (
SELECT Id, Ranking = ROW_NUMBER() OVER(ORDER BY Reputation DESC)
FROM Users
)
,Counts AS (
SELECT Count = COUNT(*)
FROM Users
WHERE Reputation > 101
)
  SELECT Id, Ranking, 100 * (1 - CAST(Ranking AS decimal(10, 5)) / (SELECT Count FROM Counts)) AS Percentile
FROM Rankings
WHERE Id = ##UserId##

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results