Q&A about the site for members of the workforce navigating the professional setting
---see also: https://data.stackexchange.com/mathoverflow/query/1177886/posts-where-some-text-missing-in-the-earlier-revision-was-added-including-the-ed?word=web.archive.org ; with revisions_cte as ( SELECT DISTINCT p.Id AS pid, ph1.Id AS phId FROM PostHistory ph1 INNER JOIN Posts p ON ph1.PostId=p.Id WHERE ph1.PostHistoryTypeId in (2,5,8) and NOT(ph1.Text Like '%##word?newcommand##%') and (p.Body Like '%##word##%') ), firstrev_cte AS (SELECT pid, MIN(ph2.Id) as MinId FROM revisions_cte INNER JOIN PostHistory ph2 ON ph2.PostId=pid WHERE (ph2.Id>phId) AND ph2.PostHistoryTypeId in (2,5,8) AND (ph2.Text Like '%##word##%') GROUP BY pid ) --- 2 = Initial Body - initial post raw body text --- 5 = Edit Body - modified post body (raw markdown) --- 8 = Rollback Body - reverted body (raw markdown) SELECT COUNT(PostId) AS [Count], UserId AS [User Link], UserDisplayName FROM PostHistory INNER JOIN firstrev_cte ON PostHistory.Id=MinId GROUP BY UserId, UserDisplayName ORDER BY Count(PostId) DESC