Highest daily post scores

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP 250
  Votes.PostId AS [Post Link],
  Posts.OwnerUserId AS [User Link],
  CASE WHEN Posts.PostTypeId = 1 THEN 'Q' ELSE 'A' END As 'Type',
  SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE -1 END) AS DayScore,
  Votes.CreationDate
FROM Votes
Join Posts ON Posts.Id = Votes.PostId
WHERE Votes.VoteTypeId IN (2,3)
GROUP BY Votes.PostId, Votes.CreationDate, Posts.OwnerUserId, Posts.PostTypeId
ORDER BY DayScore DESC

Enter Parameters

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