[oracle] 남은 날짜 계산하기 SELECT CP_START_DATE ,CP_END_DATE ,DECODE(SIGN(TRUNC(TRUNC(TRUNC( TRUNC((TO_DATE('20141001','YYYYMMDD') - SYSDATE) * (24*60*60)) /60)/60)/ 24)),1, TRUNC(TRUNC(TRUNC( TRUNC((TO_DATE('20141001','YYYYMMDD') - SYSDATE) * (24*60*60)) /60)/60)/ 24),0) AS DAYCOUNT FROM COUPON; [oracle] 남은 날짜 계산하기