Percentage of Answers on Closed Questions


Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace

Q&A for members of the workforce navigating the professional setting

    COUNT(aPosts.ID) [Total Answers],
    COUNT(qPosts.ClosedDate) [Answers on Closed Questions],
    COUNT(qPosts.ClosedDate) * 100 / COUNT(aPosts.ID) as [Percentage of Answers on Closed Questions]
FROM Posts as aPosts 
LEFT JOIN Posts as qPosts 
  ON qPosts.PostTypeID = 1 --Questions
  AND qPosts.ID = aPosts.ParentID
WHERE aPosts.PostTypeID = 2 --Answers

Enter Parameters

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