I want to write a SQL query which accepts a bind variable (say :NUM) and its output consists of one column & :NUM number of rows, each row having its row number. i.e. if we
WITH cte_numbers(n) AS ( SELECT 0 UNION ALL SELECT n + 1 FROM cte_numbers WHERE n < 10 ) SELECT n FROM cte_numbers;
Returned Rows 0 1 2 3 4 5 6 7 8 9 10