日期:2014-05-18 浏览次数:20490 次
--2005 select * from( select *,rid=row_number() over (partition by a order by b desc) from tb )t where rid <= 6
------解决方案--------------------
--2000 select * from tb t where [主键字段] in (select top 6 [主键字段] from tb where a = t.a order by b desc)