My rank among all users ordered by total reputation

1

Please login or register to vote for this query.

(click on this box to dismiss)

Economics

Q&A for those who study, teach, research and apply economics and econometrics

;with users_ranked as (
select RANK() OVER(ORDER BY u.Reputation DESC) AS rnk,
  u.id AS uid,
  u.Reputation rep 
FROM Users u 
)

SELECT 
  'You',
  r.rnk AS [Rank],
  r.uid AS [User Link],
  r.rep AS [Reputation]
FROM users_ranked r
WHERE r.uid = ##userid##
UNION ALL
SELECT 
  'Community',
  r.rnk AS [Rank],
  r.uid AS [User Link],
  r.rep AS [Reputation]
FROM users_ranked r
ORDER BY 1 DESC, r.rep DESC

Enter Parameters

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