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 about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors
-- 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 Rank, 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