What is the answers/questions reputation ratio?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

WITH T AS 
(
select 
--p.OwnerUserId,
Q = ISNULL(SUM(CASE WHEN posttypeid = 1 THEN CASE VoteTypeId WHEN 2 THEN 5 WHEN 3 THEN -2 END END),0), 
A = ISNULL(SUM(CASE WHEN posttypeid = 2 THEN CASE VoteTypeId WHEN 2 THEN 10 WHEN 3 THEN -2 ELSE 15 END END),0) 
from posts p
join votes v on v.postid = p.id
where posttypeid in (1 --question
                   ,2) --answer
                   and votetypeid in (1 --accept
                                     ,2 -- up
                                     ,3) --down
--group by p.OwnerUserId
)
SELECT CAST(A AS FLOAT)/Q
FROM T

Enter Parameters

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