instruction: Unmerged answered self-duplicates (list of stub Qs). Find duplicate questions where OP from the stub post (source) is the same OP as from the destination post (master/target) and both stub/source and master/target questions have answers (hence, they are candidates to be merged).
response: WITH stub_list AS (SELECT p.Id, p.Score, p.OwnerUserId, pl.RelatedPostId FROM Posts AS p JOIN PostLinks AS pl ON pl.PostId = p.Id WHERE p.PostTypeId = 1 AND EXISTS(SELECT * FROM PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (10)) AND pl.LinkTypeId = 3 AND p.AnswerCount > 0) SELECT s.Id AS "post_link", s.Score FROM stub_list AS s JOIN Posts AS p ON p.Id = s.RelatedPostId WHERE s.OwnerUserId = p.OwnerUserId ORDER BY s.Score