SELECT a1.* FROM t_content a1
INNER JOIN
(SELECT a.channelId,a.id FROM t_content a LEFT JOIN t_content b
<![CDATA[ ON a.channelId=b.channelId AND a.id<=b.id ]]>
AND a.status=2
GROUP BY a.channelId,a.id
<![CDATA[ HAVING COUNT(b.id)<=10]]>
)b1
ON a1.channelId=b1.channelId AND a1.id=b1.id
ORDER BY a1.channelId,a1.id DESC