update x set b=(select sum(a) from x t1 where t1.id=x.id)
update 表名 set b=(select sum(a) from 表名 group by 时间字段
update tab set b=(select sum(a) from tab group by rollup('日期列');
update tab set b = b + a;