SQL
1.分组前3条数据
select * from (
SELECT a.categoryid,a.infoid from information a where (select count(*) from information b where a.CategoryID =b.categoryid and a.infoid>b.infoid)<3
order by a.categoryid,infoid
) c where c.CategoryID in (28) ;
select * from (
SELECT a.categoryid,a.infoid from information a where (select count(*) from information b where a.CategoryID =b.categoryid and a.infoid>b.infoid)<3
order by a.categoryid,infoid
) c where c.CategoryID in (28) ;