Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLrecursive CTEsSingle-choice MCQ

What does the recursive part of this CTE compute, and what is the final result?

WITH RECURSIVE nums(n) AS ( SELECT 1 UNION ALL SELECT n + 1 FROM nums WHERE n < 5 ) SELECT n FROM nums;