My HNQs

0

Please login or register to vote for this query.

(click on this box to dismiss)

TeX Meta

Q&A about the site for users of TeX, LaTeX, ConTeXt, and related typesetting systems

DECLARE @UserId INT = ##UserId##;

SELECT hnq.PostId AS [Post Link],
  p.PostTypeId,
  u.DisplayName AS [User Link],
  hnq.CreationDate,
  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;

/*
SELECT DISTINCT p.Id AS [Post Link],p.PostTypeId,u.DisplayName AS [User Link], p.CreationDate
FROM Posts p
JOIN Users u ON p.OwnerUserId = u.Id
JOIN PostHistory ph ON p.Id = ph.PostId
WHERE (OwnerUserId = @UserId) AND (ph.PostHistoryTypeId = 52)
ORDER BY p.Id ASC
*/

Enter Parameters

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