โพสต์ป้ายคะแนนที่เปลี่ยนแปลงบ่อยที่สุด ไม่จำเป็นต้องใช้ทุกตาราง
Post changed score sign most times.It is not neccessary to use all the tables.
 CloseReasonTypes:  Id [ number]  Name [ text]  Description [ text] 
WITH Raw AS (SELECT PostId, Id AS VoteId, SUM(5 - 2 * VoteTypeId) OVER (PARTITION BY PostId ORDER BY Id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS ScoreNow FROM Votes WHERE VoteTypeId IN (2, 3)), Raw2 AS (SELECT PostId, VoteId, ScoreNow, RANK() OVER (PARTITION BY PostId ORDER BY VoteId) AS N FROM Raw WHERE ScoreNow IN (-1, 1)) SELECT Prev.PostId AS "post_link", 'site:///posts/' + CAST(Prev.PostId AS TEXT) + '/timeline|' + CAST(Prev.PostId AS TEXT) AS Timeline, COUNT(*) AS Count FROM Raw2 AS Prev, Raw2 AS Next WHERE Prev.PostId = Next.PostId AND Prev.N + 1 = Next.N AND Prev.ScoreNow * Next.ScoreNow = -1 GROUP BY Prev.PostId ORDER BY Count DESC LIMIT 100