ย้ายไปยัง dba.se แล้ว ไม่จำเป็นต้องใช้ตารางทั้งหมด
s migrated to dba.se.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] 
SELECT COUNT(p.Id) FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id AND pt.Name = 'Question' JOIN PostHistory AS ph ON ph.PostId = p.Id JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId AND pht.Name = 'Post Migrated Here' WHERE EXISTS(SELECT 1 FROM Posts AS ap JOIN PostTypes AS apt ON apt.Id = ap.PostTypeId AND apt.Name = 'Answer' WHERE ap.ParentId = p.Id) AND NOT EXISTS(SELECT 1 FROM Posts AS ap JOIN PostTypes AS apt ON apt.Id = ap.PostTypeId AND apt.Name = 'Answer' WHERE ap.ParentId = p.Id AND ap.CreationDate >= ph.CreationDate)