คำถามที่ติดแท็กด้วย [แท็ก] ที่ถูกปิด ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
Questions tagged with [tag] that were closed.It is not neccessary to use all the tables.
 ReviewTaskStates:  Id [ number]  Name [ text]  Description [ text] 
SELECT COUNT(Posts.Id) AS "questions_posted" FROM Posts LEFT JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND STR_POSITION(Posts.Tags, @tag) > 0 AND NOT Posts.ClosedDate IS NULL AND PH.PostHistoryTypeId = @offtopic