日期:2014-05-17 浏览次数:21804 次
SELECT to_char(SYSDATE,'YYYY') - LEVEL + 1 years FROM dual connect by LEVEL <= 5 ORDER BY 1
------解决方案--------------------
LS的是转换先成年了 再计算 也可以先计算再转成年
select to_char(add_months(sysdate,-12*(level-1)),'yyyy') yy from dual connect by level<=5
------解决方案--------------------
select to_char(sysdate,'yyyy') from dual
union
select to_char(sysdate-365,'yyyy') from dual
union
select to_char(sysdate-365*2,'yyyy') from dual
union
select to_char(sysdate-365*3,'yyyy') from dual
union
select to_char(sysdate-365*4,'yyyy') from dual
------解决方案--------------------