select spbm,spmc,wlbzs as 数量,50-(select sum(wlbzs) from ecspywxx tb where tb.spbm<=ta.spbm) as 累计差值,(select sum(wlbzs) from ecspywxx tb where tb.spbm<=ta.spbm) as 累计 from ecspywxx ta
SQL行累加/递减
最新推荐文章于 2024-07-25 23:12:39 发布
select spbm,spmc,wlbzs as 数量,50-(select sum(wlbzs) from ecspywxx tb where tb.spbm<=ta.spbm) as 累计差值,(select sum(wlbzs) from ecspywxx tb where tb.spbm<=ta.spbm) as 累计 from ecspywxx ta