Answers with lots of votes, total votes, votes of last year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

SELECT top 10 a.Id, a.Score, Sum(CASE WHEN Year(v.CreationDate) >= 2020 and v.VoteTypeId = 2 THEN 1 WHEN Year(v.CreationDate) >= 2020 and v.VoteTypeId = 3 THEN -1 ELSE 0 END) as [ScoreLastYear]
FROM Posts a
INNER JOIN Posts q
ON q.Id = a.ParentId
INNER JOIN Votes v
ON a.Id = v.PostId
WHERE a.Score >= 50 and Year(a.CreationDate) < 2018 and q.ClosedDate is null
GROUP BY a.Id, a.Score

Enter Parameters

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