Oracle 查询连续的年份

 

查询获取 5年的连续年份:

 SELECT (TO_NUMBER(TO_CHAR(SYSDATE,'YYYY'))-ROWNUM+1) || '' AS TEXT,(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY'))-ROWNUM+1) || '' AS VALUE FROM DUAL CONNECT BY ROWNUM<6

  
  

没有更多推荐了,返回首页