What Percentile of Users am I in (reputation-wise)?

3

Please login or register to vote for this query.

(click on this box to dismiss)

Emacs

Q&A for those using, extending or developing Emacs

declare @TotalRep bigint
declare @Top10RepTotal bigint
declare @Bottom90RepTotal bigint

select @TotalRep = sum(reputation) from users

select @Top10RepTotal = sum(tmp.rep) from
          (select top(10) percent reputation as rep
           from users
           order by reputation desc) as tmp

select @Bottom90RepTotal = sum(tmp.rep) from
          (select top(90) percent reputation as rep
           from users
           order by reputation) as tmp

select @TotalRep TotalRep, 
       @Top10RepTotal Top10RepTotal,
       @Bottom90RepTotal Bottom90RepTotal,
       (cast(@Top10RepTotal as float)/cast(@TotalRep as float))*100 Top10PercentageOfRep,
       (cast(@Bottom90RepTotal as float)/cast(@TotalRep as float))*100 Bottom90PercentageOfRep

Enter Parameters

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