Closed question percentage for informed vs uninfomed users

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

SELECT
  100.0 * sum(case when b.id is null and p.ClosedDate is not null then 1 else 0 end)
        / sum(case when b.id is null then 1 else 0 end)
    AS pClosedUninf
  , sum(case when b.id is not null and p.ClosedDate is not null then 1 else 0 end) * 100.0
    / sum(case when b.id is not null then 1 else 0 end)
    AS pClosedInf
FROM ReviewTasks rt
JOIN PostsWithDeleted p on rt.postid = p.id and rt.reviewtasktypeid = 4
LEFT JOIN Badges b
ON
  b.userid = p.owneruserid
  and b.name = 'Informed'
  and (b.date < p.ClosedDate or p.ClosedDate is null)

Enter Parameters

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