SELECT DATEPART(Year, Users.CreationDate), COUNT(*) FROM ...

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 DATEPART(Year, Users.CreationDate), COUNT(*) FROM Users
WHERE EXISTS(SELECT 1 FROM Posts
  WHERE Posts.OwnerUserId = Users.Id
  AND Posts.PostTypeId = 2 -- answer
  AND Posts.Score > 0
  AND DATEDIFF(Month, Users.CreationDate, Posts.CreationDate) < 3)
GROUP BY DATEPART(Year, Users.CreationDate)
ORDER BY DATEPART(Year, Users.CreationDate)

Enter Parameters

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