What percentage of users have I exceeded with reputation?

0

Please login or register to vote for this query.

(click on this box to dismiss)

3D Printing Meta

Q&A for 3D printing enthusiasts

declare @myRep int = ( select reputation from users where id=##UserID## )

select
  sum(case when reputation < @myRep then 1 else 0 end ) as aLowerScore,
  sum(case when reputation > @myRep then 1 else 0 end ) as aHigherScore
into #userList from users 

select 
@myRep as [Reputation], 
aLowerScore, 
aHigherScore,   
format((aLowerScore*1.0) /(aLowerScore+aHigherScore),'0%') as HigherThan
from  #userList

Enter Parameters

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