Reasons for downvotes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

SELECT DATEPART(year, p.CreationDate)*100+DATEPART(month, p.CreationDate) AS yearweek,
COUNT(DISTINCT p.Id) AS TotalCount,
COUNT(DISTINCT CASE WHEN p.Score < 0 THEN p.Id ELSE NULL END) AS DownvotedCount,
COUNT(DISTINCT p.ClosedDate) AS ClosedCount,
COUNT(DISTINCT CASE WHEN ph.comment='101' THEN p.Id ELSE NULL END) AS DuplicateCount,
COUNT(DISTINCT CASE WHEN ph.comment='102' THEN p.Id ELSE NULL END) AS OffTopicCount,
COUNT(DISTINCT CASE WHEN ph.comment='103' THEN p.Id ELSE NULL END) AS UnclearCount,
COUNT(DISTINCT CASE WHEN ph.comment='104' THEN p.Id ELSE NULL END) AS TooBroadCount,
COUNT(DISTINCT CASE WHEN ph.comment='105' THEN p.Id ELSE NULL END) AS OpinionBasedCount
FROM Posts p
INNER JOIN PostHistory ph ON p.Id = ph.PostId
WHERE p.PostTypeId = 1 AND p.CreationDate between '2014-01-01' and '2015-12-31'
GROUP BY DATEPART(year, p.CreationDate)*100+DATEPART(month, p.CreationDate)

Enter Parameters

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