The 50 highest ranked comments with post links. Ignores comments on posts that have been migrated as this is unfair to poor little sites with lots of StackOverflow migrations.
Q&A for professional and enthusiast programmers
-- Top-ranked comments -- The 50 highest ranked comments with post links. Ignores comments on posts -- that have been migrated as this is unfair to poor little sites with lots of -- StackOverflow migrations. SELECT TOP 50 ROW_NUMBER() OVER (ORDER BY Comments.Score DESC) as '#', Comments.PostId as [Post Link], Comments.UserId as [User Link], Comments.Score, Comments.Text FROM Comments WHERE NOT EXISTS (SELECT * FROM PostHistory WHERE PostId = Comments.PostId AND PostHistoryTypeId=17) ORDER BY Comments.Score DESC