Using the DUAL table, how can I get a list of numbers from 1 to 100?
+5
A:
Your question is difficult to understand, but if you want to select the numbers from 1
to 100
, then this should do the trick:
Select Rownum r
From dual
Connect By Rownum <= 100
Peter Lang
2010-05-17 07:26:06
+1
A:
Peter's answer is my favourite, too.
If you are looking for more details there is a quite good overview, IMO, here.
Especially interesting is to read the benchmarks.
Unreason
2010-05-17 08:46:21
+1
A:
Another interesting solution in ORACLE PL/SQL:
SELECT LEVEL n
FROM DUAL
CONNECT BY LEVEL <= 100;
The chicken in the kitchen
2010-05-17 10:58:24
This is plain Oracle SQL. It works fine outside a PL/SQL context.
Vadim K.
2010-05-17 17:21:10