SQL to generate a list of numbers from 1 to 100

ramachandrareddy picture ramachandrareddy · May 17, 2010 · Viewed 133.4k times · Source

Using the DUAL table, how can I get a list of numbers from 1 to 100?

Answer

Peter Lang picture Peter Lang · May 17, 2010

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