View recent edits to tag wikis and excerpts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

DECLARE @max_days_ago int = 180

SELECT
  u.Count,
  u.TagName,
  u.LastEditDate,
  u.LastEditorUserId AS [User Link],
  'site://edit-tag-wiki/'+CAST(u.Id AS varchar)+'|(edit)' AS [Edit],
  'site://posts/'+CAST(u.WikiPartId AS varchar)+'/revisions|('+u.Type+' hist)' AS [Hist]
FROM
  (SELECT t.Count, t.TagName, p.LastEditDate, p.LastEditorUserId, t.Id, 
          t.ExcerptPostId AS [WikiPartId], 'excerpt' AS [Type]
   FROM Tags AS t LEFT OUTER JOIN Posts p ON t.ExcerptPostId = p.Id
   UNION ALL
   SELECT t.Count, t.TagName, p.LastEditDate, p.LastEditorUserId, t.Id, 
          t.WikiPostId AS [WikiPartId], 'wiki' AS [Type]
   FROM Tags AS t LEFT OUTER JOIN Posts p ON t.WikiPostId = p.Id) AS u
WHERE
  DATEDIFF(DAY, u.LastEditDate, GETDATE()) < @max_days_ago
ORDER BY
  [LastEditDate] DESC

Enter Parameters

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