SELECT *, IFNULL(parent, id) AS p, IFNULL(reply_comment_id, id) AS r
FROM article_comments ORDER BY p ASC, r ASC, date DESC
我想使用限制。如果我有更多行,我想将查询限制为“p”。在图像中:("p": 1, 1, 1, 1, 1) – 这是一个,("p": 2, 2, 2, 2, 2, 2, 2) – 这是两个...
例如,我想要:如果我使用 LIMIT 1,则只显示 ("p": 1, 1, 1, 1, 1)。