instruction: Answers per answered question - with or without self-answer.
response: SELECT SUM(CASE WHEN pa.Id IS NULL THEN 1 ELSE 0 END) AS NnonSelf, SUM(CASE WHEN NOT pa.Id IS NULL THEN 1 ELSE 0 END) AS NSelf, SUM(CASE WHEN pa.Id IS NULL THEN p.AnswerCount ELSE 0 END) * 1.0 / SUM(CASE WHEN pa.Id IS NULL THEN 1 ELSE 0 END) AS AvgAnsNonSelf, SUM(CASE WHEN NOT pa.Id IS NULL THEN p.AnswerCount ELSE 0 END) * 1.0 / SUM(CASE WHEN NOT pa.Id IS NULL THEN 1 ELSE 0 END) AS AvgAnsSelf FROM Posts AS p LEFT OUTER JOIN Posts AS pa ON pa.PostTypeId = 2 AND pa.ParentId = p.Id AND pa.CreationDate = p.CreationDate AND pa.OwnerUserId = p.OwnerUserId WHERE p.ClosedDate IS NULL AND p.PostTypeId = 1 AND p.AnswerCount > 0