Generating rows without using a dummy table
Earlier this week I attended a presentation by Tom Kyte and learnt a method to generate rows which I have not seen before. I wrote his example down wrong but after some googling I have found something similar. It appears to be an excellent method but I just can't understand why it works:
SQL> select numbers.num from
2 (select rownum num
3 from dual
4 connect by rownum <6 ) numbers;
NUM
----------
1
2
3
4
5
SQL> select rownum num
2 from dual
3 connect by rownum <6 ;
NUM
----------
1
Can anyone please explain how the first example works, and also why the second does not produce the same result ?