ปิดโหวตสำหรับแท็กใดแท็กหนึ่ง ไม่จำเป็นต้องใช้ตารางทั้งหมด
close votes for particular tags.It is not neccessary to use all the tables.
 PostTypes:  Id [ number]  Name [ text] 
SELECT p.Id, p.Id AS "post_link", p.CreationDate, p.Score, COUNT(PostHistory.Id) AS HistCount FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN Posts AS p ON p.Id = PostTags.PostId JOIN PostHistory ON PostHistory.PostId = p.Id WHERE Tags.TagName IN ('python') AND PostHistory.PostHistoryTypeId = 10 AND p.ClosedDate IS NULL AND p.PostTypeId = 1 AND p.Score < -3 GROUP BY p.Id, p.CreationDate, p.Score ORDER BY p.Score /* select * from PostHistory where PostId=@someId */ LIMIT 100