First All-time user on each page in /User

0

Please login or register to vote for this query.

(click on this box to dismiss)

Deterimines the rep of the user is for each page in /User and what the difference is to the next page

Italian Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language

-- First All-time user on each page in /User
-- Deterimines the rep of the user is for each page in /User and what the difference is to the next page


WITH 
CTE AS (
SELECT top 5000 
row_number() over (order by reputation Desc) rn, reputation
FROM
 users),
pageInfo as (
SELECT 
       rn, 
       reputation,
       row_number() over (order by rn) page
FROM 
CTE
WHERE rn % 36 = 1 or rn = 1
)
Select pi.page, pi.reputation, prev.reputation - pi.reputation difference
from pageInfo pi
  LEFT join pageInfo prev
  ON pi.page = prev.page + 1
ORDER BY pi.page

Enter Parameters

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