What percentage of my answers are accepted?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns the total number of answers, the number of accepted answers, and what percentage of answers are accepted.

Christianity

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

-- What percentage of my answers are accepted?
-- Returns the total number of answers, the number of accepted answers, and what percentage of answers are accepted.

SELECT
    Count(a.Id) AS [Total Answers],
    Sum(CASE WHEN q.AcceptedAnswerId IS NULL THEN 0 ELSE 1 END) AS [Accepted Answers],  
    Round(Sum(CASE WHEN q.AcceptedAnswerId IS NULL THEN 0 ELSE 1 END) * 100.0 / Count(a.Id), 1) AS [Percentage Accepted]
FROM
    Posts AS a
  LEFT JOIN
    Posts AS q
  ON a.Id = q.AcceptedAnswerId
WHERE
      a.OwnerUserId = ##UserId##
  AND a.postTypeId = 2

Enter Parameters

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