tags:

views:

162

answers:

3

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
+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
+1  A: 

Another interesting solution in ORACLE PL/SQL:

    SELECT LEVEL n
      FROM DUAL
CONNECT BY LEVEL <= 100;
The chicken in the kitchen
This is plain Oracle SQL. It works fine outside a PL/SQL context.
Vadim K.