Questions which were answered by the longest delay

1

Please login or register to vote for this query.

(click on this box to dismiss)

We can't see if an answer was accepted and then unaccepted. Thus, we only see the questions which have only a single accepted answer (deleted or not).

Ask Ubuntu

Q&A for Ubuntu users and developers

-- questions with a single answer
WITH Raw AS (
  SELECT Q.Id AS QId, MIN(Q.AcceptedAnswerId) AS AId
  FROM PostsWithDeleted Q, PostsWithDeleted A
  WHERE A.ParentId = Q.Id AND Q.AcceptedAnswerId IS NOT NULL
  GROUP BY Q.Id
  HAVING COUNT(*)=1
)
SELECT TOP 100
  A.Id AS [Post Link],
  Q.CreationDate AS QCreated,
  Q.OwnerUserId AS [User Link],
  A.OwnerUserId AS [User Link],
  A.CreationDate AS ACreated,
  DATEDIFF(s, Q.CreationDate, A.CreationDate) AS Delay
FROM Raw, PostsWithDeleted Q, PostsWithDeleted A
WHERE
  Raw.QId = Q.Id
  AND
  Raw.AId = A.Id
  AND
  A.OwnerUserId != Q.OwnerUserId
ORDER BY Delay DESC, Q.Id

Enter Parameters

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