Questions edited by OP

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- My edit history
-- Shows edits to posts I did not originally create

SELECT 
  CASE 
    WHEN (P.PostTypeId = 1) THEN P.Title 
    ELSE (SELECT TOP 1 Title FROM Posts WHERE Posts.Id = P.ParentId)
  END AS [Question Title], 
  PHT.Name + 
    CASE 
      WHEN P.PostTypeId = 1 THEN ' of question' 
      ELSE ' of answer' 
    END AS [Edit Type],
  PH.CreationDate AS [Edit Date],
  'site://questions/' + CONVERT(VARCHAR, P.Id)+'|Post #' + CONVERT(VARCHAR, P.Id) AS [Link]
FROM PostHistory AS PH, Posts AS P, PostHistoryTypes AS PHT
WHERE 
  (P.Id = PH.PostId AND PH.PostHistoryTypeId = PHT.Id) -- joins
  AND PH.UserId = ##UserId## AND P.OwnerUserId = ##UserId##
  AND P.PostTypeId = 1
ORDER BY PH.CreationDate ASC

Enter Parameters

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