if OBJECT_ID('tempdb..#linshi') is not null
drop table #linshi
SELECT id=identity(int,1,1), Cost
into #linshi
FROM XXXX Order By Cost Desc
select * ,count=(
select sum(Cost) from linshi i where i.id<o.id
) from #linshi o
posted @
2014-09-04 11:19Toby Wang
阅读(472)
评论(0)
收藏举报