Q&A for professional and enthusiast programmers
select posts.id as [Post Link], pq.creationdate as [Protection date] from posthistory as pq inner join posts on pq.postid = posts.id inner join posttags on posttags.postid = posts.id inner join tags on posttags.tagid = tags.id left outer join posthistory as uq on uq.postid = posts.id and uq.posthistorytypeid = 20 and uq.creationdate > pq.creationdate where pq.posthistorytypeid = 19 and uq.posthistorytypeid is null and tags.tagname = ##TagName:string## order by pq.creationdate desc