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)

Computer Graphics

Q&A for computer graphics researchers and programmers

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.00%') as HigherThan
from  #userList

Enter Parameters

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