perc of rep come from answer upvote


Please login or register to vote for this query.

(click on this box to dismiss)

Find the highest-rep users whose combined reputation is more than X% of the total user reputation. Let's make Pareto proud.

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

-- should be larger than 1 because daily rep cap

DECLARE @MyAnswerUpped       int = 0; -- +10

    --@MyAnswerUpped = COUNT(*)
    --select count(*) *10 as AnsRep, max(t1.Reputation) as TotRep ,t1.Id
    select avg((nAccepted *15 + nUp*10)/Rep) as avgRepRatio,count(*) as nUser from
select sum(case when Q.AcceptedAnswerId is null then 0 else 1 end) as nAccepted,
     count(*) as nUp, max(t1.Reputation) as Rep ,t1.Id as userId
FROM Posts

    INNER JOIN Votes ON Posts.Id = Votes.PostId 
                      and Votes.VoteTypeId = 2 
                      and Posts.PostTypeId = 2
      select  Id, Reputation 
      from Users

      where Reputation > 100000 and Reputation < 110000

      )as t1 ON t1.Id = Posts.OwnerUserId 
    LEFT JOIN Posts AS Q ON Q.Id = Posts.ParentId and Q.AcceptedAnswerId = Posts.Id
group by t1.Id
)as tratio

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results