17,078
社区成员
发帖
与我相关
我的任务
分享
update CUSTAMONT_2017_07 c
set day07 =
(select sum(s.zhhuye)
from sdckcrm s
where s.coreacno = c.coreacno
group by coreacno)
先筛选后分组计算,二十万数据在coreacno 加个索引,飞快~update CUSTAMONT_2017_07 c set day07 = (select sum(s.zhhuye) from sdckcrm s where s.coreacno = c.coreacno group by coreacno )
先筛选后分组计算update custamont_2017_07 c
set c.day07 = (select sum(s.zhhuye) from sdckcrm s where s.coreacno = c.coreacno)
where exists(select null from sdckcrm s where s.coreacno = c.coreacno);
commit;