Markdown for posts by a deleted user

1

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

;with lastrev_cte AS
(
SELECT MAX(ph.Id) AS MaxId, 
  p.Id AS pid,
  p.OwnerUserId AS uid,
  p.OwnerDisplayName AS udn,
  p.PostTypeId AS ptype
FROM Posts p JOIN PostHistory ph ON ph.PostId=p.Id
WHERE ph.PostHistoryTypeId in (2,5,9)
GROUP BY p.Id, p.OwnerUserId, p.OwnerDisplayName, p.PostTypeId
)

SELECT 
pid AS [Post Link],
ph.Text
FROM lastrev_cte l INNER JOIN PostHistory ph ON l.MaxId=ph.id
WHERE (udn='user' + Convert(nvarchar(20), ##UserId?9072##)) AND (ptype IN (##types?1,2##))
ORDER BY pid DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results