next_tay(date,string) 返回在date之后由string指定条件的第一天

解决方案 »

  1.   

    Purpose
    NEXT_DAY returns the date of the first weekday named by char that is later than the date d. The argument char must be a day of the week in the date language of your session, either the full name or the abbreviation. The minimum number of letters required is the number of letters in the abbreviated version. Any characters immediately following the valid abbreviation are ignored. The return value has the same hours, minutes, and seconds component as the argument d. Example
    This example returns the date of the next Tuesday after March 15, 1998. SELECT NEXT_DAY('15-MAR-98','TUESDAY') "NEXT DAY"
         FROM DUAL;
     
    NEXT DAY
    ---------
    16-MAR-98 
      

  2.   

    select next_day(sysdate,3) from dual;
    表示下星期二?
      

  3.   

    如果SYSDATE的日期是星期一,
    那么select next_day(sysdate,3) from dual;显示的应该是此星期的星期二,
    如果sysdate的日期是星期三,
    那么select next_day(sysdate,3) from dual;显示的就是下星期的星期二。
      

  4.   

    select next_day(sysdate,2) from dual;
    次语句返回当前日期后的第一个星期一
    n代表星期几,0代表星期日;