最近项目中遇到,记录下来
方法可以是:
select '1' month from dual union all
select '2' month from dual union all
select '3' month from dual union all
select '4' month from dual union all
select '5' month from dual union all
select '6' month from dual union all
select '7' month from dual union all
select '8' month from dual union all
select '9' month from dual union all
select '10' month from dual union all
select '11' month from dual union all
select '12' month from dual;
select '2' month from dual union all
select '3' month from dual union all
select '4' month from dual union all
select '5' month from dual union all
select '6' month from dual union all
select '7' month from dual union all
select '8' month from dual union all
select '9' month from dual union all
select '10' month from dual union all
select '11' month from dual union all
select '12' month from dual;
或者
select lpad(level,2,0) from dual connect by level<13