Can anyone explain how this racursive CTE works?

Kanagavel A

Kanagavel A

@kanagavel-a-eJ4OGB Oct 25, 2024
with


factorial(n,fact)as
(
select
2,cast(2 asfloat)
union
all
select
n+1,(n+1)*fact
from
factorial
where
n<50
)
select
n,fact
from
factorial

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform