ratio of questions to answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A for administrators, end users, developers and designers for Craft CMS

SELECT Users.Id,
  CAST(ABS(SUM(Posts.PostTypeId - 2)) AS FLOAT) AS Asked,
  CAST(SUM(Posts.PostTypeId -1) AS FLOAT) AS Answered
FROM Users
LEFT JOIN Posts on Posts.OwnerUserId = Users.Id
GROUP BY Users.Id

Enter Parameters

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