Reputation_last2month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

-- StackOverflow Rank and Percentile

WITH Rankings AS (
SELECT Id, Ranking = ROW_NUMBER() OVER(ORDER BY Reputation ASC), Reputation,LastAccessDate
FROM Users
)
,Counts AS (
SELECT Count = COUNT(*)
FROM Users
WHERE Reputation > 1
)
SELECT Id, Ranking, CAST(Ranking AS decimal(15, 5)) / (SELECT Count FROM Counts) AS Percentile,
Reputation, LastAccessDate
FROM Rankings
WHERE LastAccessDate >= DATEADD(m, -2, GETDATE())

Enter Parameters

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