--取出点击量最高的文章100篇,每个作者不超过5篇 select top 100 id,title,tips,author from ( select *,cnt=row_number() over (partition by author order by tips desc) from tb ) t where cnt <=5 order by tips desc
本文转自:http://www.cnblogs.com/zengxiangzhan/archive/2010/01/03/1638147.html