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
Post a Comment