Reopened success rates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Code Review

Q&A for peer programmer code reviews

with QRs as (
    select distinct PostId, 'Reopened' as Reop
    from PostHistory
    where PostHistoryTypeId = 11
), Qs as (
    select p.Id,
       IsNull(Reop, 'OK') as State,
       AnswerCount,
       Score
    from Posts p
    left outer join QRs on p.Id = QRs.PostId
    where p.PostTypeId = 1
      and ClosedDate is null
)
select State,
       count(Id) as QCount,
       sum (AnswerCount) as Answers,
       avg(1.0 * AnswerCount) as AvgAnswers,
       sum(Score) as Scores,
       avg(1.0 * Score) as AvgScores
from Qs
group by State

Enter Parameters

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