instruction: Unanswered questions migrated to dba.se.
response: 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)