🎂 10 years 🎂

Thanks to all my readers for being so faithful 🙂
I’ll post a new solution to calculate factorial.

This is the one I posted 10 years ago :
https://laurentschneider.com/2005/05/recursive-sql.html

I also used it in the obfuscation contest


with function f (x number) return number 
is 
begin 
  return case x when 1 then x else x*f(x-1) end; 
end;
select value(t), f(value(t)) 
from table(sys.odcinumberlist(4,6))t

  VALUE(T) F(VALUE(T))
---------- -----------
         4          24
         6         720

It is neither quicker nor shorter than the one I posted in 2005, but it could not have worked in 2005

Leave a Reply

Your email address will not be published.

*