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) ;

posted @ 2012-11-14 13:09  zhengguoqing  阅读(216)  评论(0编辑  收藏  举报