Implementation of select sysdate from dual; get the current date: 2014/4/30 14:11:33 Wednesday
select next_day(sysdate,'星期日') from dual;
Get date: 2014/5/4 14:12:53
From this Wednesday to get the number of days Sunday
If the execution select next_day (sysdate, 'Sunday') from dual;
Get date 2014/5/6 14:14:31, to obtain the number of days from next Tuesday this Wednesday, rather than the number of date Tuesday
Therefore next_day (sysdate, 'XXXX') function returns is to begin to get from the current date to the date of the next several weeks.
select next_day(to_date('2014-4-1','yyyy-MM-dd'),'星期三') from dual;
The first few weeks after the date obtained from a specific date.