Last comments by deleted users - count by month

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

---Last comments by deleted users
---divided by month
;  with last_cte as
(
SELECT
    UserDisplayName,
    MAX(Id) AS MaxId
FROM Comments
WHERE UserId IS Null
GROUP BY UserDisplayName
), dates_cte as
(
SELECT
  c.UserDisplayName AS odn, c.Id AS cid, c.CreationDate AS CDate
  FROM Comments c INNER JOIN last_cte ON c.Id=maxid
)

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