1. 相差天数
select to_date('03-31-1999','MM-DD-YYYY')-to_date('08-31-1999','MM-DD-YYYY') 时间 from dual;
2.相差月数
select months_between(to_date('03-31-1999','MM-DD-YYYY'),to_date('08-31-1999','MM-DD-YYYY')) as mon from dual;
3.求某天是周几
select to_char(to_date('2002-08-26','yyyy-mm-dd'),'day') from dual; --星期一