L
SELECT * FROM (SELECT CEIL(LEVEL / 7) ww , MOD(LEVEL - 1, 7) + 1 dy , TO_CHAR(TRUNC(dt, 'd') + LEVEL - 1, 'dd') dd FROM (SELECT TO_DATE('202210', 'yyyymm') dt FROM dual) CONNECT BY LEVEL <= TRUNC(LAST_DAY(dt), 'd') + 6 - TRUNC(dt, 'd') + 1 ) PIVOT (MIN(dd) FOR dy IN (1 sun, 2 mon, 3 tue, 4 wed, 5 thu, 6 fri, 7 sat)) ;
질문이 왜이리 됐을까요..?