I just found the following in an
article at AskTom ...
It's a perfect example for the fact that simpler is better.
I've read many times the following solution for the problem:
SELECT
rownum as seq
FROM
all_objects
WHERE 1 = 1
AND ROWNUM <= 100
I was always reluctant to use this approach since the all_objects view utilizes a number of underlying tables, a lot of resources for this little task (or at least a lot of resources for my taste).
The solution in Tom's article uses a hierarchical query on the DUAL table. What a brilliant idea!
SELECT
rownum as seq
FROM dual
CONNECT BY
LEVEL <= 100
Recent comments
1 year 44 weeks ago
3 years 14 weeks ago
3 years 14 weeks ago
3 years 16 weeks ago
3 years 17 weeks ago
3 years 23 weeks ago
3 years 23 weeks ago
3 years 24 weeks ago
3 years 24 weeks ago
3 years 24 weeks ago