一个参数 nls_date_language
alter session set nls_date_language='simplified chinese';会话已更改。
idle>select next_day ( to_date ('2006-10-10','yyyy-mm-dd'),'TUESDAY') NEXT_DAY FROM DUAL;
select next_day ( to_date ('2006-10-10','yyyy-mm-dd'),'TUESDAY') NEXT_DAY FROM DUAL
*
ERROR 位于第 1 行:
ORA-01846: 周中的日无效
idle>select next_day ( to_date ('2006-10-10','yyyy-mm-dd'),'星期二') NEXT_DAY FROM DUAL;
NEXT_DAY
----------
17-10月-06
idle>alter session set nls_date_language='american';
会话已更改。
idle>select next_day ( to_date ('2006-10-10','yyyy-mm-dd'),'TUESDAY') NEXT_DAY FROM DUAL;
NEXT_DAY
---------
17-OCT-06
idle>select next_day(sysdate,'friday') from dual;
NEXT_DAY(
---------
28-JUL-06
---或者你用数字,则不管nls_date_language是如何了,只是计算出几天后。idle>select next_day(sysdate,2) from dual;
NEXT_DAY(
---------
24-JUL-06
idle>alter session set nls_date_language='simplified chinese';
会话已更改。
idle>select next_day(sysdate,2) from dual;
NEXT_DAY(S
----------
24-7月 -06
select to_char(to_date('2002-08-26','yyyy-mm-dd'),'day','NLS_DATE_LANGUAGE = American') from dual;
TO_CHAR(TO_DATE('2002-08-26','
------------------------------
monday
select to_char(to_date('2006-02-20','yyyy-mm-dd'),'dd-mon-yy','NLS_DATE_LANGUAGE = American')
V_date from dual;
转自: http://zhouwf0726.itpub.net/post/9689/159301