contributors with 3+ answers per week since Oct. 2011

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

DECLARE @refdate DATETIME = DATEFROMPARTS(2011,10,1);
SELECT
  DATEADD(week, MIN(C.WeekNumber), @refdate) AS WeekNumber,
  COUNT(*) AS UserCount
FROM (
SELECT
  DATEDIFF(week, @refdate, P.CreationDate) AS WeekNumber
  --MAX(P.OwnerUserId) AS UserId
FROM Posts P
WHERE P.CreationDate >= @refdate
GROUP BY
  P.OwnerUserId,
  DATEDIFF(week, @refdate, P.CreationDate)
HAVING COUNT(*) >= 3
) C
GROUP BY WeekNumber
ORDER BY WeekNumber

Enter Parameters

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