Count of users grouped by hundreds of their asked questions.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
  ((userQuestions.QuestionCount / 100) * 100) AS [Questions count], 
  COUNT(UserQuestions.userId) AS [Users count]
FROM 
 (SELECT soUser.Id AS userId, COUNT(post.Id) AS QuestionCount
  FROM Posts AS post
    INNER JOIN Users AS soUser
    ON soUser.Id = post.OwnerUserId
  WHERE post.PostTypeId = 1
  GROUP BY soUser.Id) AS userQuestions
GROUP BY (userQuestions.QuestionCount  / 100)
ORDER BY (userQuestions.QuestionCount  / 100) DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results