假设:
机构表为o,业务数据表为d,
o中"预留有编码字段"为f2,代码是id
则
select o1.id, sum(d.data)
from o o1, o o2, d
where o2.id like o.id||'%'
and d.id=o2.id
group by o1.id;
机构表为o,业务数据表为d,
o中"预留有编码字段"为f2,代码是id
则
select o1.id, sum(d.data)
from o o1, o o2, d
where o2.id like o.id||'%'
and d.id=o2.id
group by o1.id;
结账!