factorial of a number
Hi all,
I am trying to write a sql that can calculate the factorial from a single sql.with this query I can reach uptill :
with t as
(select 10 num from dual)
select ltrim(max(sys_connect_by_path(rownum,'*')),'*') factorial
from t
connect by rownum <= num
Output: 1*2*3*4*5*6*7*8*9*10
Now my requirements are as follows:
1) great if some1 could help me in writing an outer query on top of mine to get the desired result
2) suggest some other way to make me understand how to calculate factorial of a number from scratch.
Thanks
Rahul