What is my accepted answer percentage rate

0

Please login or register to vote for this query.

(click on this box to dismiss)

On avg how often are answers I give, accepted

Stack Overflow

Q&A for professional and enthusiast programmers

-- What is my accepted answer percentage rate
-- On avg how often are answers I give, accepted

DECLARE @UserId int = ##UserId##

;WITH [answers] AS (
  SELECT 
     a.*,
     IIF(q.AcceptedAnswerId = a.Id, 1, 0) AS isAccepted
  FROM
      Posts q
  INNER JOIN
      Posts a ON q.Id = a.ParentId
  WHERE
      a.OwnerUserId = @UserId
    AND
      a.PostTypeId = 2
)
SELECT 
(SELECT Count(*) FROM answers WHERE isAccepted = 1 OR Score > 0) AS p
FROM answers

Enter Parameters

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