新闻表主要字段
id,class_id
查询新闻根据class_id分组,分组内按id desc排序
select n1.* from news n1
where n1.`class_id` in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)group by n1.`class_id`,n1.id having (select count(n2.id) from news n2 where n2.class_id=n1.class_id and n2.id>=n1.id)<=10 order by n1.class_id desc