Questions - number and percentage of accepted answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Writing

Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

; with askersaccepted_cte AS
(SELECT 
  q.OwnerUserId AS uid, 
  q.OwnerDisplayName AS udn,
  COUNT(q.Id) AS QCount,
  SUM(CASE WHEN (q.AnswerCount>0) THEN  1 ELSE 0 END) AS Acount,
  COUNT(q.AcceptedAnswerId) AS AccCount
  FROM Posts q
  GROUP BY q.OwnerUserId, q.OwnerDisplayName
 )
 
 SELECT TOP(##num?500##)
  uid AS [User Link],
  udn AS [Display Name],
  AccCount AS [Questions with accepted answer],
  ACount AS [Questions with at least one answer],
  QCount AS [All Questions],
  ROUND(AccCount*100.0/ACount,2) AS percentage
FROM askersaccepted_cte
WHERE (ACount>=##min?10##)
--restrict to users with non-negligible number of answered questions  
ORDER BY AccCount DESC

Enter Parameters

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