请教一下各位大佬,想要实现 在一级、二级、三级、四级项目下的金额逐级汇总 ,四-->三,三-->二,二-->一。
select cno,
cname,
f_cno,
clevel,
type,
sign,
cmoney,
(select sum(t.cmoney)
from cpppp t where connect_by_isleaf = '1'
start with t.cno = a.cno and t.type='2'
connect by prior t.cno = t.f_cno )
from cpppp a where type='2'但是出现的问题是,存在多个一级项目,汇总之后,汇总数据错误。 希望大佬给指点一下 ,谢谢!!!
select cno,
cname,
f_cno,
clevel,
type,
sign,
cmoney,
(select sum(t.cmoney)
from cpppp t where connect_by_isleaf = '1'
start with t.cno = a.cno and t.type='2'
connect by prior t.cno = t.f_cno )
from cpppp a where type='2'但是出现的问题是,存在多个一级项目,汇总之后,汇总数据错误。 希望大佬给指点一下 ,谢谢!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货