User Rank and Hoarded Rep

1

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

Select Top 20
  p.Id as [User Link], 
  p.Ranking, 
  substring(cast(Cast(Ranking as Decimal)/Count*100.00 as varchar), 1,6) + '%' as Percentile,
  Reputation,
  substring(cast(Cast(Reputation as Decimal)/Sum*100.00 as varchar), 1,6) + '%' as 'Hoarded rep'
From
  (Select 
    Id, 
    ROW_NUMBER() OVER(ORDER BY Reputation DESC) as Ranking,
    Reputation
  From 
    Users) as p,
  (SELECT Count = COUNT(*)
  FROM Users
  ) as Counts,
  (Select Sum = Sum(Reputation)
  From Users
  --Where Reputation > 1
  ) as Rep

--Where p.Id = ##UserId?47188##

Enter Parameters

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