oracle数据库累加方法

2024-12-29 03:31:52
推荐回答(4个)
回答1:

update x set b=(select sum(a) from x t1 where t1.id=x.id)

回答2:

update 表名 set b=(select sum(a) from 表名 group by 时间字段

回答3:

update tab set b=(select sum(a) from tab group by rollup('日期列');

回答4:

update tab set b = b + a;