SELECT TO_DATE ('20110101', 'yyyymmdd') + ROWNUM - 1 rq,
TO_CHAR (TO_DATE ('20110101', 'yyyymmdd') + ROWNUM - 1, 'DAY')
theday
FROM (SELECT ROWNUM
FROM DUAL
CONNECT BY ROWNUM <=
TO_DATE ('20111231', 'yyyymmdd')
- TO_DATE ('20110101', 'yyyymmdd')
+ 1)