Percentage of closed but not deleted questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

A question that is bad enough to be closed is a candidate for deletion.

Stack Overflow

Q&A for programmers

-- Percentage of closed but not deleted questions
-- A question that is bad enough to be closed is a candidate for deletion.

select
  Year(creationdate) as [Year], Month(creationdate) as [Month],
  count(id) as [Posted],
  sum(case when closeddate is null then 0 else 1 end) as [Closed but not deleted],
  round(100.0*sum(case when closeddate is null then 0 else 1 end)/count(id),2) as [Percent]
from posts
where posttypeid = 1
group by Year(creationdate), Month(creationdate)
order by Year(creationdate), Month(creationdate);

Enter Parameters

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