sql - Oralcle generate number column inline (single statement) -


i working on oracle , having difficulty on generating column of defined range (say, 2008 2011). know there sequences method see here.

however, want have inline php can work smoothly.

i know there rather ugly way of doing it; instance

select 2008 yr dual  union  select 2009 yr dual union  select 2010 yr dual union  select 2011 yr dual 

is there more dynamic way?

thanks kind assistance

try this:

select 2008 + level-1 yr dual connect level <  5 

change constants needed.


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -