Saturday, March 25

Oracle and calendering

Did a quick calendering script in Oracle, someone may find it usefull.
SELECT to_char(sysdate, 'YYYY/MM/')||lpad(rownum,2,'0')
FROM (SELECT 1 FROM dual
CONNECT BY LEVEL <= to_char(last_day(sysdate), 'DD')
)
/
Will print
2006/03/1
...
2006/03/31

No comments: