- 使用子查询进行查询
SELECT
*
FROM
home_content a
WHERE
(
SELECT
count(id)
FROM
home_content
WHERE
class_link = a.class_link
AND id > a.id
) <= 2
SELECT
*
FROM
home_content a
WHERE
(
SELECT
count(id)
FROM
home_content
WHERE
class_link = a.class_link
AND id > a.id
) <= 2