请教一下各位大佬,想要实现 在一级、二级、三级、四级项目下的金额逐级汇总 ,四-->三,三-->二,二-->一。
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'但是出现的问题是,存在多个一级项目,汇总之后,汇总数据错误。  希望大佬给指点一下 ,谢谢!!!