Showing post which were (were not) removed from the HNQ lists

1

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

;  with revisions_cte as
(
SELECT
  ph.PostId AS pid,
  MAX(ph.id) AS phid
FROM PostHistory ph
WHERE ph.PostHistoryTypeId in (52,53)
GROUP BY ph.PostId
)


SELECT TOP(##num?100##)
  r.pid AS [Post Link],
  concat('site://posts/',
          ph.PostId,
          '/revisions'
          ) [Revisions Link],
  ph.PostHistoryTypeId, 
  CASE ph.PostHistoryTypeId
    WHEN 52 THEN 'Stayed'
    WHEN 53 THEN 'Removed'
  END AS Statys,
  ph.UserId AS [User Link]
FROM PostHistory ph INNER JOIN revisions_cte r ON ph.id=r.phid
ORDER BY r.pid DESC

Enter Parameters

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