Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more
; 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 (1,4,7) and NOT(ph1.Text Like '%$%') ), 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 (1,4,7) AND (ph2.Text Like '%$%') GROUP BY pid ) --- 1 = Initial Title - initial title (questions only) --- 4 = Edit Title - modified title (questions only) --- 7 = Rollback Title - reverted title (questions only) SELECT PostId AS [Post Link], revisions = 'site://posts/' + CAST(PostId AS varchar)+'/revisions', ph.UserId AS [User Link], ph.UserDisplayName, ph.CreationDate FROM PostHistory ph INNER JOIN firstrev_cte f ON ph.PostId=f.pid WHERE (ph.PostHistoryTypeId=53) AND (ph.id>f.minid) ORDER BY CreationDate DESC