Showing posts with label CONNECT BY LEVEL. Show all posts
Showing posts with label CONNECT BY LEVEL. Show all posts

Jan 4, 2010

Query to generate incremental numbers in Oracle

Small tip to generate incremental numbers that developers need it sometimes.
So if I want to generate numbers from 1 to 30, I will write:

SELECT     ROWNUM
      FROM DUAL
CONNECT BY LEVEL <= 30;