Answerers vs total posters

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

with anyParticipation as
(
  SELECT DISTINCT
  DATEADD(month, DATEDIFF(month, 0, creationDate), 0) month,
  p.ownerUserId 
  FROM Posts p
  
  UNION
  
  SELECT DISTINCT
  DATEADD(month, DATEDIFF(month, 0, creationDate), 0) month,
  c.UserId ownerUserId
  FROM Comments c
),
answerParticipation as
(
  SELECT DISTINCT
  DATEADD(month, DATEDIFF(month, 0, creationDate), 0) month,
  p.ownerUserId 
  FROM Posts p
  WHERE p.postTypeId = 2
)


SELECT 
ap.month, count(distinct ap.ownerUserId)
FROM anyParticipation ap --change me
GROUP BY ap.month
ORDER BY ap.month

Enter Parameters

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