Answer the question
In order to leave comments, you need to log in
How to sort in Closure Table?
There are tables
comments-id,name...
comments_tree- ancestor_id, descendant_id,parent_id,
level
that is, if, for example, a comment was added to the tree a year later and has an id of 666 and the first parent id is 1.
And between them there are a cloud of other trees with comments, then the whole tree was still taken until the whole tree was passed
SELECT
*
FROM comments c
JOIN comments_tree ct ON c.id = ct.descendant_id
ORDER BY ct.level ASC
Limit..
OFFSET..
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question