java,php,asp.net,linux,javascript,mysql,mssql,oracle,编程

向上求和 sql

转载请注明:http://www.pmjava.com/Article/ShowInfo.asp?ID=56713
declare @kw_test_sumup table  (a int identity(1,1) primary key not null, b int)
insert into @kw_test_sumup(b)
   
select 2 union all
   
select 3 union all
   
select 4 union all
   
select 5 union all
   
select 5 union all
   
select 16 union all
   
select 16 union all
   
select 16
select * from @kw_test_sumup
select a.a,sum(b.b) [sum up above]
from @kw_test_sumup a,@kw_test_sumup b where a.a >= b.a group by a.a order by a.a

posted on 2009-06-12 18:23 rrong_m 阅读(101) 评论(0)  编辑  收藏

<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

随笔档案

文章分类

文章档案

java编程

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜