Percentage of Answers that have been accepted

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity Meta

Q&A about the site for committed Christians, experts in Christianity and those interested in learning more

-- Total number of answers accepted 

SELECT
u.Displayname AS Name, 
COUNT(*) AS AccAns,
TotalAns,
ROUND(((COUNT(*)+0.0) / TotalAns+0.0),2) AS PercAcc,
u.Reputation AS Rep,
a.OwnerUserId
FROM Posts AS a 
  JOIN Users AS u ON a.OwnerUserId = u.Id
  JOIN 
      (
       SELECT COUNT(*) AS TotalAns, t.OwnerUserId
       FROM Posts AS t
       WHERE PostTypeID = 2 
       GROUP BY t.OwnerUserId
      ) AS t2 ON t2.OwnerUserId=a.OwnerUserId
WHERE a.Id IN (SELECT AcceptedAnswerId FROM Posts) AND TotalAns > 9
GROUP BY a.OwnerUserID, u.Displayname, TotalAns, u.Reputation
ORDER BY Rep DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results