My Answer Count Over Time By Month (forked)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Literature

Q&A for scholars and enthusiasts of literature

With MyPostsWithDates AS (
  SELECT p.Id, p.CreationDate, FORMAT(p.CreationDate, 'yyyy-MM') As DateFormat,
         p.Score, p.OwnerUserId, p.PostTypeId
  FROM Posts p
  WHERE p.OwnerUserId = 11742502
)

SELECT CAST(d.DateFormat+'-01' AS DATETIME)
      ,COUNT(CASE WHEN d.PostTypeId=2 THEN 1 END) AS [Answer Count]
      --,SUM(CASE WHEN d.PostTypeId=1 THEN d.Score END) AS [Question Score]
      --,SUM(CASE WHEN d.PostTypeId=2 THEN d.Score END) AS [Answer Score]    
FROM MyPostsWithDates d
GROUP BY d.DateFormat
ORDER BY d.DateFormat

Enter Parameters

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