這樣?
create table temp  (
itemcode varchar(20),
quantity int,
combocode varchar(20),
comboqty int
)
insert into Temp
select '19060',0,'19060R',252
union all
select '19060',0,'NT2-650',252
union all
select '19066',0,'19066R',120
union all
select '19066',0,'NT2-30',132
union all
select '19067',0,'19067R',12
union all
select '19067',0,'NT2-30',132
union all
select '19312',0,'19312R',612
union all
select '19312',0,'NT2-45',600
union all
select '19666',0,'19666R',548
union all
select '19666',0,'NT2-80',600select *,累加=(select isnull(sum(comboqty),a.comboqty) from temp where itemcode=a.itemcode and comboqty<a.comboqty) 
from temp aitemcode             quantity    combocode            comboqty    累加
-------------------- ----------- -------------------- ----------- -----------
19060                0           19060R               252         252
19060                0           NT2-650              252         252
19066                0           19066R               120         120
19066                0           NT2-30               132         120
19067                0           19067R               12          12
19067                0           NT2-30               132         12
19312                0           19312R               612         600
19312                0           NT2-45               600         600
19666                0           19666R               548         548
19666                0           NT2-80               600         548(10 個資料列受到影響)