, "" , 2 . , .
SELECT
wpcoms.*
FROM
( SELECT
*,
@num := if(@post_id = c1.comment_post_ID, @num + 1, 1) as row_number,
@post_id := c1.comment_post_ID as cpID
FROM
( select distinct c2.comment_post_id
from wp_comments c2
where c2.comment_approved = 1
order by c2.comment_post_id desc
limit 6 ) Just6
JOIN wp_comments c1
ON Just6.comment_post_id = c1.comment_post_id
WHERE
c1.comment_approved = 1
ORDER BY
c1.comment_post_ID DESC,
c1.comment_ID DESC
) as wpcoms
WHERE
wpcoms.row_number <= 2
ORDER BY
wpcoms.comment_date DESC
LIMIT 6;
, , , DISTINCT PER COMMENT_POST_ID 6 . ___, , 6. , 6 . , 6 , 6. , 12 , 2 6 .
, , wp_comments. AT LEAST # 1
1. ( comment_approved, comment_post_id )
2. ( comment_post_id, comment_id )