with as 的用法
with t
as(
select
a.id,
(select sum([数量]) from test b where b.id<=a.ID) as [累加值]
from
test a
)
update test
set [累加值]=t.[累加值] from t where test.ID=t.ID
运行上述语句提示“在关键字 'with' 附近有语法错误。”请各位帮忙看看到时是哪里有问题
------解决方案--------------------你数据库是2000 还是2005
2000不支持with