Provable longest accepted answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Apps

Q&A for apps, scripts, and development with the Stack Exchange API

SELECT TOP 100
  A.Id AS [Post Link],
  Q.CreationDate AS QCreated,
  A.CreationDate AS ACreated,
  1.0 * DATEDIFF(s, Q.CreationDate, A.CreationDate) / 86400 AS DayDiff
FROM Posts Q, Posts A
WHERE
  Q.Id = A.ParentId
  AND
  Q.Id IN (
    SELECT Id
    FROM Posts
    WHERE
      PostTypeId = 1
      AND
      Id NOT IN (
        SELECT Q.Id
        FROM PostsWithDeleted Q, PostsWithDeleted A
        WHERE
          A.ParentId = Q.Id
          AND
          A.DeletionDate IS NOT NULL
      )
      AND
      AnswerCount = 1
      AND
      AcceptedAnswerId IS NOT NULL
  )
  AND
  Q.OwnerUserId IS NOT NULL
  AND
  A.OwnerUserId IS NOT NULL
  AND
  Q.OwnerUserId <> A.OwnerUserId
ORDER BY DayDiff DESC;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results