SELECT
*
FROM
home_content a
WHERE
(
SELECT
count(id)
FROM
home_content
WHERE
class_link = a.class_link
AND id > a.id
) <= 2
原文:https://www.cnblogs.com/phonecom/p/10691490.html