Q&A for committed Christians, experts in Christianity and those interested in learning more
; with firstrev_cte AS ( SELECT p.Id AS pid, MIN(ph.Id) as MinId FROM PostHistory ph INNER JOIN Posts p ON ph.PostId=p.Id WHERE ph.PostHistoryTypeId in (3,6,9) AND ph.Text Like '%<##tagName##>%' GROUP BY p.Id ) SELECT pid AS [Post Link], url = 'site://posts/' + CAST(PostId AS varchar)+'/revisions', UserId AS [User Link], UserDisplayName FROM PostHistory INNER JOIN firstrev_cte ON PostHistory.Id=MinId