Created
February 10, 2012 22:55
-
-
Save gregrahn/1793790 to your computer and use it in GitHub Desktop.
row generator using recursive subquery factoring (recursive with / recursive CTE) in Oracle. More: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#BABCDJDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RecursiveCTE (rnum) AS | |
( | |
SELECT 1 AS rnum | |
FROM dual | |
UNION ALL | |
SELECT rnum + 1 | |
FROM RecursiveCTE | |
WHERE rnum < 24 | |
) | |
SELECT rnum | |
FROM RecursiveCTE; | |
RNUM | |
---------- | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
24 rows selected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment