Number of users which made their last post in a given month (only users with at least 10 posts)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

;  with last_cte as
(
SELECT
    OwnerUserId,
    Max(Id) AS MaxId,
    Count(Id) AS num
FROM Posts
GROUP BY OwnerUserId
), dates_cte as
(
SELECT
  p.OwnerUserId AS odn, p.Id AS pid, p.CreationDate AS CDate
  FROM Posts p INNER JOIN last_cte l ON p.Id=maxid
  WHERE l.num>=##min?10##
)

SELECT eomonth(CDate),
  COUNT(odn)
FROM dates_cte
GROUP BY eomonth(CDate)
ORDER BY eomonth(CDate)

Enter Parameters

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