Dup Questions


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for professionals and students of engineering

  questions.Id AS QuestionId,
  questions.Title AS QuestionTitle,
  SUBSTRING(history.Text, CHARINDEX('[', history.Text), CHARINDEX(']', history.Text) - CHARINDEX('[', history.Text) + 1) AS Duplicate,
  questions.AcceptedAnswerId AS AcceptedAnswer,
  answers.Id AS MostVotedAnswer,
  answers.Score AS Votes,
  history.Text AS History
FROM Posts questions
INNER JOIN Posts answers ON answers.ParentId = questions.Id
INNER JOIN PostHistory history ON history.PostId = questions.Id
  questions.Id < 50
) AND (
  history.PostHistoryTypeId = 10
) AND (
  answers.Id IN (
    SELECT TOP 1 p.Id
    FROM Posts p
    WHERE p.ParentId = questions.Id
    ORDER BY p.Score DESC
ORDER BY answers.Score DESC

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results