SELECT TO_CHAR(DAY + LEVEL -1, 'yyyyMMdd') AS years ,
TO_CHAR(DAY + LEVEL -1, 'dd') AS dates ,
TO_CHAR(TO_DATE('20160727')+1,'fmiw') - TO_CHAR(TRUNC(TO_DATE('20160727'),'mm')+1,'fmiw')+1 WEEK ,
CASE TO_CHAR(DAY + LEVEL -1, 'd')
WHEN '1'
THEN 'Sun'
WHEN '2'
THEN 'Mon'
WHEN '3'
THEN 'Tue'
WHEN '4'
THEN 'Wed'
WHEN '5'
THEN 'Thu'
WHEN '6'
THEN 'Fri'
WHEN '7'
THEN 'Sat'
END AS YOIL
FROM
(SELECT TRUNC(TO_DATE( '20160727','YYYYMMDD'),'D') AS DAY
FROM dual
) CONNECT BY LEVEL <= 7 ;
이 쿼리를 오라클 11g에 날렸는데 자꾸 에러가 납니다.
ORA-01861: literal does not match format string
조언 좀 부탁드리겠습니다 감사합니다.