2008.06.25 10:05
SELECT TRUNC (MONTHS_BETWEEN (SYSDATE, TO_DATE (:HAPPYDAY, 'YYYYMMDD')) / 12) "년"
     , TRUNC (  MONTHS_BETWEEN (SYSDATE, TO_DATE (:HAPPYDAY, 'YYYYMMDD'))
              - TRUNC (MONTHS_BETWEEN (SYSDATE, TO_DATE (:HAPPYDAY, 'YYYYMMDD')) / 12) * 12
             ) "개월"
     , TRUNC (  (  MONTHS_BETWEEN (SYSDATE, TO_DATE (:HAPPYDAY, 'YYYYMMDD'))
                 - TRUNC (MONTHS_BETWEEN (SYSDATE, TO_DATE (:HAPPYDAY, 'YYYYMMDD')))
                )
              * 30.5
             ) "일"
  FROM DUAL;
신고
Posted by 커피한잔의여유

티스토리 툴바