First, create a CTE with nums, cur, and factorial. Then select the num, 1 as cur and 1 as factorial.
Next you will union this with nums, cur + 1, and factorial * (cur + 1), which would give you the next level. You have to join the CTE and the nums ta...