Average question score for all users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mi Yodeya

Q&A for those who base their lives on Jewish law and tradition and anyone interested in learning more

SELECT
  --u.id as [User Link],
  u.displayname,
  COUNT(1) AS questions_count,
  SUM(a.score) AS total_score,
  SUM(a.score) * 1.0 / COUNT(1) AS avg_score
FROM users u
JOIN posts a
  ON u.id = a.owneruserid
  AND a.posttypeid = 1
GROUP BY u.id, u.displayname
HAVING COUNT(1) >= 2
order by avg_score desc, questions_count desc

Enter Parameters

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