Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: sql question
Chris,
SQL> select * from table(betwixt('15-APR-2006','20-APR-2006'));Hope this helps!
DT
-----------
16-APR-2006
17-APR-2006
18-APR-2006
19-APR-2006
20-APR-2006
5 rows selected.
SQL> select to_char(dt,'YYYY') from table(betwixt('01-JAN-1995','01-JAN-2006',366));
TO_C
----
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
11 rows selected.
-- http://www.freelists.org/webpage/oracle-l Received on Thu Apr 20 2006 - 15:54:01 CDTCan 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