HNQs for a user in SO

0

Please login or register to vote for this query.

(click on this box to dismiss)

Bicycles

Q&A for people who build and repair bicycles, people who train cycling, or commute on bicycles

DECLARE @UserId INT = ##UserId##;

SELECT hnq.PostId AS [Post Link],
  p.PostTypeId,
  u.DisplayName AS [User Link],
  EnteredHNQ = hnq.CreationDate,
  RemovedHNQ = nhnq.CreationDate
FROM PostHistory AS hnq
INNER JOIN Posts AS p
ON hnq.PostId = p.Id
INNER JOIN Users AS u
ON p.OwnerUserId = u.Id
LEFT OUTER JOIN PostHistory AS nhnq
ON hnq.PostId = nhnq.PostId
AND nhnq.PostHistoryTypeId = 53
WHERE u.Id = @UserId
AND hnq.PostHistoryTypeId = 52;

Enter Parameters

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