原创 sql SUM()累加

select 編號, 完成數=(select sum(完成數) from tb where 編號<=a.編號) from tb a