Lo que necesitas es la multiplicación acumulativa. Pero no existe tal función como función agregada o analítica. Pero las matemáticas nos dicen que la multiplicación se puede cambiar a suma usando logaritmo .
a * b = exp(ln(a) + ln(b))
Use esto en SUM como función analítica. No es necesario utilizar la construcción CONNECT BY.
recurreten as
(
select YR, YSet,
rtnpct rtn_year,
round(exp(sum(ln(rtnpct)) over (order by yr, yset rows between unbounded preceding and current row)),2) ccr,
exp(sum(ln(rtnpct)) over (order by yr, yset rows between unbounded preceding and current row)) ccrfull
from Z_RETENTIONPCT
)
select * from recurreten
order by yr, yset
| YR | YSET | RTN_YEAR | CCR | CCRFULL |
|------|------|----------|------|----------------|
| 1998 | 20 | 0.84766 | 0.85 | 0.84766 |
| 1999 | 21 | 0.77941 | 0.66 | 0.6606746806 |
| 2000 | 22 | 0.78659 | 0.52 | 0.519680097013 |
| 2001 | 23 | 0.76879 | 0.4 | 0.399524861783 |
| 2002 | 24 | 0.80952 | 0.32 | 0.32342336611 |
| 2003 | 25 | 0.76316 | 0.25 | 0.246823776081 |
| 2004 | 26 | 0.82425 | 0.2 | 0.203444497435 |
| 2005 | 27 | 0.6992 | 0.14 | 0.142248392606 |
| 2006 | 28 | 0.77071 | 0.11 | 0.109632258666 |
| 2007 | 29 | 0.702 | 0.08 | 0.076961845583 |