select TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'mm') as month , rownum as day from dual,
(select null as month, rownum from dual where rownum <= TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'dd')) test1
CONNECT BY LEVEL <= TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'dd')
일단 이쿼리를 만들어 원하는년도와 달을 입력하면
데이터를 뽑게되는데 컬럼을 하나더만들어 옆에 요일까지 뽑을수 있을까요?
--올려주신 질의어를 이용했습니다. SELECT month, day, (SELECT TO_CHAR(TO_DATE(:yymm||LPAD(day, 2, '0')) - 1, 'D') FROM DUAL) AS day FROM ( select TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'mm') as month, rownum as day from dual, (select null as month, rownum from dual where rownum <= TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'dd') ) test1 CONNECT BY LEVEL <= TO_CHAR(LAST_DAY(TO_DATE(:yymm,'yyyymm')),'dd') )