Percentage of Questions Upvoted Lower than the Highest Upvoted Answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Musical Practice and Performance

Q&A for musicians, students, and enthusiasts

-- Context: https://stackapps.com/q/8505/34061

SELECT ROUND(AVG(CASE WHEN QuestionScore < HighestAnswerScore
                      THEN 100.0 ELSE 0.0 END), 2) AS 'Percentage'
FROM
(SELECT q.Id, MAX(q.Score) AS QuestionScore, MAX(a.Score) AS HighestAnswerScore
  FROM Posts AS q
  INNER JOIN Posts AS a
  ON a.ParentId = q.Id
  GROUP BY q.Id) AS Scores

Enter Parameters

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