Q&A for users and developers of the Cardano cryptocurrency ecosystem
SELECT TOP(##num?500##) RANK() OVER(ORDER BY c.Score DESC) AS Rank, c.Score, c.Id AS [Comment Link], c.Text, UserId AS [User Link], c.UserDisplayName, c.CreationDate, p.Id AS [Post Link], p.Score, q.Tags, q.ViewCount FROM Comments c INNER JOIN Posts p ON c.PostId=p.Id INNER JOIN Posts q ON coalesce(p.ParentId, p.Id)=q.Id ORDER BY c.Score DESC