WITH comment_ranks AS( SELECT cm.Id, cm.PostId, RANK() OV...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

WITH comment_ranks AS(
SELECT cm.Id, cm.PostId,
       RANK() OVER (
       PARTITION BY cm.PostId
       ORDER BY cm.CreationDate DESC ) cmt_rank
FROM comments cm
)
SELECT *
  FROM comment_ranks
WHERE cmt_rank <= 100;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results