select A,B=(Select sum(B) from tbl where A=x.A and B<=x.B)
from tbl as x
from tbl as x
解决方案 »
- 关于数据库结构询问
- 請教一個多表查詢的問題
- MS SQL中如何判断,例如,字符'FLEX'是否存在于表EMPLOYER的NAME字段中?
- SQL 转化txt出问题 -------一定给分
- 邹老大在不在? 把 excel 数据导入到 SQL Server 中,导入的数据不对。
- 怎么解决呀???
- 行转列视图
- sql server 自增字段????????麻烦各位朋友了
- dbcc checkdb repair_allow_data_loss
- 有关于fn_Split函数问题!!!!
- 锛侊紒锛侊紒锛佹€庢牱浠嶸isio瀵煎叆鍒癝qlServer2000锛燂紙鍦ㄧ嚎绛夛紝鎬ワ紒锛侊級
- 两个select语句的区别
a 1
a 10
a 3
a 10要得到结果a 1
a 11
a 14
a 24就不行了请高手赐教
select IDENTITY(int, 1, 1) as id,* into #tbl from tbl
select A,B=(Select sum(B) from tbl where A=x.A and id<=x.id)
from #tbl as x
select IDENTITY(int, 1, 1) as id,* into #tbl from tbl
select A,B=(Select sum(B) from #tbl where A=x.A and id<=x.id)
from #tbl as x