Questions Closed as Duplicates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy Meta

Q&A about the site for science fiction and fantasy enthusiasts

/*SELECT PH.PostID, PH.Text, PH.Comment AS [Post Link]
FROM PostHistory AS PH
INNER JOIN Votes AS V
ON PH.PostID = V.PostID
AND PH.PostHistoryTypeId = 10
AND PH.Comment = 101*/

/*select PH.PostID, PH.Text
FROM PostHistory as PH
INNER JOIN PostLinks AS PL
ON PL.RelatedPostId = PH.PostID
and  PL.LinkTypeId=3*/

select
  p.Id,
  p.Title,
  p.Body,
  p.Tags,
  p2.Id,
  p2.Title,
  p2.Body,
  p2.Tags
from
  posts p
  inner join PostHistory as ph on ph.postid = p.id
  inner join Posts P2 on P2.id = JSON_VALUE(ph.Text, '$.OriginalQuestionIds[0]')
where
  p.posttypeid = 1 -- q
  and ph.PostHistoryTypeId = 10 -- closed
  and ph.comment = 101 -- as duplicate

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results