Longest times between close-reopen, accepted answer after reopening

1

Please login or register to vote for this query.

(click on this box to dismiss)

Tezos

Q&A for users, experts, and developers of the Tezos blockchain project

WITH Raw AS (
  SELECT
    PostId,
    PostHistoryTypeId,
    RANK() OVER (PARTITION BY PostId ORDER BY Id) AS No,
    CreationDate
  FROM PostHistory
  WHERE
    PostHistoryTypeId BETWEEN 10 AND 11
    AND
    PostId IN (
      SELECT PostId
      FROM PostHistory
      WHERE PostHistoryTypeId = 11
    )
)
SELECT DISTINCT TOP 100
  C.PostId AS [Post Link],
  C.CreationDate AS Closed,
  R.CreationDate AS Reopened,
  DATEDIFF(s, C.CreationDate, R.CreationDate) AS Seconds,
  Q.Tags
FROM Raw C, Raw R, Posts Q, Posts A
WHERE
  C.PostId = R.PostId
  AND
  C.PostHistoryTypeId = 10
  AND
  R.PostHistoryTypeId = 11
  AND
  C.No + 1 = R.No
  AND
  C.PostId = Q.Id
  AND
  Q.ClosedDate IS NULL
  AND
  Q.AcceptedAnswerId = A.Id
  AND
  A.CreationDate > R.CreationDate
ORDER BY Seconds DESC

Enter Parameters

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