Q&A for users of Wolfram Mathematica
select top 20 Type, QId as [Post Link] from ( select top 90 (case when h.Comment = '2' then 'OT' else 'TL' end) as Type, q.Id as QId from PostHistory h join Posts q on q.Id=h.PostId where h.PostHistoryTypeId=10 and q.ClosedDate is not null and isnull((select top 1 PostHistoryTypeId from PostHistory where PostId=q.Id and PostHistoryTypeId in (14,15,35) order by CreationDate desc),0) not in (14,35) and (h.Comment like '2' or h.Comment like '7') order by q.CreationDate desc ) as x order by NewId()