Q&A for professional and enthusiast programmers
select PostId [Post Link], coalesce(sum(choose(posthistorytypeid-9,1,-1)), 0) closed, coalesce(sum(choose(posthistorytypeid-13,1,-1)), 0) locked, coalesce(sum(choose(posthistorytypeid-18,1,-1)), 0) protected from posthistory group by PostId having coalesce(sum(choose(posthistorytypeid-9,1,-1)), 0) not in(0, 1) or coalesce(sum(choose(posthistorytypeid-13,1,-1)), 0) not in(0, 1) or coalesce(sum(choose(posthistorytypeid-18,1,-1)), 0) not in(0, 1)