SELECT MAX(DECODE(D, 7,DAY)) SUN, MAX(DECODE(D, 1,DAY)) MON, MAX(DECODE(D, 2,DAY)) TUE , MAX(DECODE(D, 3,DAY)) WED, MAX(DECODE(D, 4,DAY)) THU, MAX(DECODE(D, 5,DAY)) FIR, MAX(DECODE(D, 6,DAY)) SAT FROM ( SELECT LEVEL DAY, TO_DATE(:YYYYMM||TRIM(TO_CHAR(LEVEL,'00'))) AS DT, TO_CHAR(TO_DATE(:YYYYMM||TRIM(TO_CHAR(LEVEL,'00'))) ,'D') AS D, DECODE(TO_CHAR(TO_DATE(:YYYYMM||TRIM(TO_CHAR(LEVEL,'00'))) ,'D'), 7, CEIL( (LEVEL + 7 - TO_NUMBER(TO_CHAR(TO_DATE(:YYYYMM||TRIM(TO_CHAR(LEVEL,'00'))) ,'D'))) /7) + 1, CEIL( (LEVEL + 7 - TO_NUMBER(TO_CHAR(TO_DATE(:YYYYMM||TRIM(TO_CHAR(LEVEL,'00'))) ,'D'))) /7) )AS W FROM DUAL CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(TO_DATE(:YYYYMM||'01')),'dd')) ) A GROUP BY W ORDER BY W
달력 쿼리 인데 양력이고요 이처럼 음력을 뽑아 보고 싶은데 방법이 없을까요?
이전에 음력 구하는 방법 게시물이 있었던것 같은데 찾지 못했네요 ㅠ