Solution to TSQL Beginners Challenge 3
with cte_fact as ( select 0 as Nums , 1 as fact union all select Nums+1, fact*(Nums+1) from cte_fact where Nums < 10 ) select distinct Nums, fact from cte_fact where Nums in (0,1,3,5,10)
Tags: