Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles
with FoundComments as (select Posts.Id as PostId, Posts.Score as PostScore, Posts.ViewCount as PostViews, Posts.CreationDate as PostDate, Posts.CommentCount as PostComments, row_number() over (partition by Posts.Id order by Comments.CreationDate asc) as RowNumber from Comments join Posts on Posts.Id = Comments.PostId where Posts.PostTypeId = 1 and Posts.Score between 0 and 1 and (Posts.Score = 0 or Posts.OwnerUserId is null) and Posts.AnswerCount = 0 and Posts.CommentCount > ##commentCount:int## and Posts.Tags LIKE '%<' + ##tag:string## + '>%' ) select PostId as [Post Link], PostScore as [Score], PostViews as [Views], PostComments as [Comments] from FoundComments as F where RowNumber = 1 order by PostId