SELECT YEAR (p.CreationDate) AS YearDate, COUNT (p.Id) AS...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

SELECT YEAR (p.CreationDate) AS YearDate,
       COUNT (p.Id) AS PostCount,
       SUM (p.CommentCount),
       COUNT (c.PostId) AS CommentCount
FROM Posts AS p
LEFT OUTER JOIN  Comments AS c ON p.Id = c.PostId
GROUP BY YEAR (p.CreationDate)
ORDER BY YEAR (p.CreationDate)

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results