Questions Closed as Duplicates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

/*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 as DId,
 p.Title as DTitle,
 p.Tags as DTags,
 p.Body as DBody,
 P2.Id as OId,
 P2.Title as OTitle,
 P2.Tags as OTags,
 P2.Body as OBody
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