Q&A for SharePoint enthusiasts
select top 10 postid, id from comments order by postid, row_number() over ( partition by postid order by creationDate desc)