Re: sql question

Chris,

This may not be the most efficient method, but it should do
what you want as long as user_objects contains at least
(current year - 1994) rows.

SELECT 1994 + rn
  FROM (SELECT row_number() over (order by object_name) rn
          FROM user_objects
         WHERE rownum <= 30)
 WHERE 1994 + rn <= TO_NUMBER(TO_CHAR(SYSDATE, 'YYYY'))

Michael T.

Chris Stephens wrote:
Can anyone think of a way to generate a list of years from say 1995 to
the current year in straight sql?


chris -- http://www.freelists.org/webpage/oracle-l



--
http://www.freelists.org/webpage/oracle-l


Other related posts: