Score history of a post

1

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Different

Q&A for power users of Apple hardware and software

WITH Raw AS (
  SELECT
    CreationDate,
    SUM(5 - 2 * VoteTypeId) AS DScore
  FROM Votes
  WHERE
    PostId=##PostId:int##
    AND
    VoteTypeId BETWEEN 2 AND 3
  GROUP BY CreationDate
)
SELECT
  CreationDate,
  SUM(DScore) OVER
    (ORDER BY CreationDate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    AS Score
FROM Raw
ORDER BY CreationDate

Enter Parameters

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