日期:2014-05-18 浏览次数:20431 次
select sum(数量) from( select *,px=row_number() over (partition by 货物 order by 日期 desc) from table1 ) t where px <= 10
------解决方案--------------------
select sum(数量) from (select top 10 数量 from table1 where 货物='a' order by 日期 desc)