Answer-to-UpVotesCast Ratio for top 100 answerers (by answer count)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computes the ratio of number of answers to up votes cast. Does not consider down votes and ignores users who have not up-voted at all.

Mathematics

Q&A for people studying math at any level and professionals in related fields

-- Answer-to-UpVotesCast Ratio for top 100 answerers (by answer count)
-- Computes the ratio of number of answers to up votes cast.
-- 
-- Does not consider down votes and ignores users who have not up-voted at all.

select
  Id as [User Link],
  Answers,
  UpVotes as "Up votes",
  cast(Answers as numeric) / (10.0 * UpVotes) as Ratio
from
  Users
inner join
  (select top 100
     OwnerUserId,count(Id) as Answers
     from Posts
     where PostTypeId = 2  --Only Answers
     group by OwnerUserId
     order by Answers desc
  ) as postCount
on postCount.OwnerUserId = Users.Id
where
  UpVotes > 0
order by
  ratio desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached