Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games
SELECT TOP ##topn:int?200## P.Id as [Post Link], p.Title, MIN(p.PostTypeId) AS Type, MIN(p.Score) AS score, COUNT(*) AS flagcount FROM PostsWithDeleted p INNER JOIN Votes v ON p.Id=v.PostId WHERE v.VoteTypeId=12 AND p.PostTypeId = 2 AND p.DeletionDate IS NULL GROUP BY p.Id, p.Title ORDER BY flagcount DESC