และการรับคะแนนเสียง ไม่จำเป็นต้องใช้ทุกตาราง
and the accept vote.It is not neccessary to use all the tables.
 PendingFlags:  Id [ number]  FlagTypeId [ number]  PostId [ number]  CreationDate [ time]  CloseReasonTypeId [ number]  CloseAsOffTopicReasonTypeId [ number]  DuplicateOfQuestionId [ number]  BelongsOnBaseHostAddress [ text] 
WITH Raw AS (SELECT DATEDIFF(day, Posts.CreationDate, CreationDate) AS days FROM Posts, Votes WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId = 1), Raw2 AS (SELECT days, COUNT(*) AS N FROM Raw GROUP BY days) SELECT days, N, SUM(N) OVER (ORDER BY days ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Raw2