SELECT A.LEV, MONTH_DATE, DAY_NAME
FROM ( SELECT LEVEL LEV,
TO_DATE (
TO_CHAR (LEVEL, '09')
|| (SELECT TO_CHAR (TO_DATE (:DATE1, 'DD-MON-RRRR'),
'MM')
FROM DUAL)
|| (SELECT TO_CHAR (TO_DATE (:DATE1, 'DD-MON-RRRR'),
'RRRR')
FROM DUAL),
'dd.mm.yyyy'
)
month_date,
TRIM(UPPER(TO_CHAR (
TO_DATE (
TO_CHAR (LEVEL, '09')
|| (SELECT TO_CHAR (
TO_DATE (:DATE1,
'DD-MON-RRRR'),
'MM'
)
FROM DUAL)
|| (SELECT TO_CHAR (
TO_DATE (:DATE1,
'DD-MON-RRRR'),
'RRRR'
)
FROM DUAL),
'dd.mm.yyyy'
),
'DAY'
)))
DAY_NAME
FROM DUAL
WHERE ROWNUM <= EXTRACT (DAY FROM LAST_DAY (:DATE1))
CONNECT BY LEVEL = ROWNUM) A
WHERE A.DAY_NAME = 'SATURDAY'
ORDER BY 1
0 comments: