日期:2014-05-17 浏览次数:20927 次
SQL> select add_months(to_date('2013-01-01','yyyy-mm-dd'),4) as newMonth from dual;
NEWMONTH
--------------
01-5月 -13
SQL> select last_day(to_date('2013-01-01','yyyy-mm-dd')) as lastday from dual;
LASTDAY
--------------
31-1月 -13
SQL> edit
已写入 file afiedt.buf
1 select months_between(to_date('2013-01-01','yyyy-mm-dd'),
2 to_date('2013-12-01','yyyy-mm-dd')) as monthsBetween
3* from dual
SQL> run
1 select months_between(to_date('2013-01-01','yyyy-mm-dd'),
2 to_date('2013-12-01','yyyy-mm-dd')) as monthsBetween
3* from dual
MONTHSBETWEEN
-------------
-11
SQL> select next_day(to_date('2013-01-08','yyyy-mm-dd'),'星期四') from dual;
NEXT_DAY(TO_DA
--------------
10-1月 -13