문자포맷
select to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss') from dual;
1개월전
select add_months(to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss'),-1) from dual;
1년전
select add_months(to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss'),-12) from dual;
1일후
SELECT to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss')+1 from dual;
10분후
select to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss')+10/(24*60) from dual;
select to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss') as a, add_months(to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss'),-1) as b, add_months(to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss'),-12) as c, to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss')+1 as d, to_date('2009-11-05 16:39:55','yyyy-mm-dd hh24:mi:ss')+10/(24*60) as d from dual;
댓글 없음:
댓글 쓰기