不用视图直接从两个表里边取数据select colmunA1,sum(decode(colmunA2,0,0,round(sum(colmunA1/colmunA2),2)) rate_A,
sum(decode((select colmunB2 from b where cellIDA=a.cellIDA),0,0,round(sum((select colmunB1 from b where cellIDA=a.cellIDA)/(select colmunB2 from b where cellIDA=a.cellIDA)),2)) rate_B
from a group by colmunA1
sum(decode((select colmunB2 from b where cellIDA=a.cellIDA),0,0,round(sum((select colmunB1 from b where cellIDA=a.cellIDA)/(select colmunB2 from b where cellIDA=a.cellIDA)),2)) rate_B
from a group by colmunA1
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货