Questions answered by a user before they were closed

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Patents Meta

Q&A about the site for people interested in improving and participating in the patent system

SELECT a.Id AS [Post Link], a.Score, a.CreationDate,
  CASE WHEN a.Score < 1            THEN 'Score too low'
       WHEN e.CreationDate IS NULL THEN 'No edit within 12 hours'
                                   ELSE 'Question closed'
  END
  FROM Posts AS q
  INNER JOIN Posts AS a
    ON a.ParentId = q.Id
   AND a.CreationDate < q.ClosedDate
  OUTER APPLY (
    SELECT TOP 1 CreationDate
      FROM PostHistory AS h
      WHERE h.PostId = q.Id
        AND h.PostHistoryTypeId IN (4, 5) -- Edit Title, Edit Body
        AND h.CreationDate BETWEEN DATEADD(HOUR, -12, a.CreationDate)
                          AND DATEADD(HOUR, 12, a.CreationDate)
        AND h.UserId = a.OwnerUserId
  ) e
  WHERE a.OwnerUserId = ##UserId:int##
  ORDER BY a.CreationDate DESC

Enter Parameters

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