17,086
社区成员
发帖
与我相关
我的任务
分享
with t1 as
(
select 1 id, null c1, 18.97/100 c2 from dual
union all
select 2 id, 0.04/100 c1, null from dual
union all
select 3 id, 0.02/100 c1, null from dual
union all
select 4 id, 0.02/100 c1, null from dual
union all
select 5 id, -0.02/100 c1, null from dual
union all
select 6 id, 0.02/100 c1, null from dual
)
select id, c1, c2
, case when id=1 then c2 else (exp(sum(ln((1+nvl(c1, 0))*(1+nvl(c2,0)))) over(order by id)))-1 end
from t1