Q&A for SharePoint enthusiasts
SELECT COUNT(a.Id) AS TotalAnswers, COUNT(CASE WHEN a.AcceptedAnswerId = a.Id THEN 1 END) AS AcceptedAnswers, (CAST(COUNT(CASE WHEN a.AcceptedAnswerId = a.Id THEN 1 END) AS FLOAT) / COUNT(a.Id)) * 100 AS AcceptanceRate FROM Posts a WHERE a.OwnerUserId = ##UserId## AND a.PostTypeId = 2;