NEXT_DAY of Oracle PL/SQL-get the date of the next week

Source: Internet
Author: User

NEXT_DAY (date, char): returns the date of the first day of the week (specified by char) after the specified date (specified by date). char can also be 1 ~ Replace 7. 1 indicates Sunday.

  1. Duzz $ scott @ orcl>SelectSysdate, to_char (sysdate,'Day') Weekday, next_day (sysdate, 1) n_day, to_char (next_day (sysdate, 1 ),'Day') N_weekdayFromDual;
  2. Sysdate weekday N_DAY N_WEEKDAY
  3. -----------------------------------------------------------
  4. 23:01:18 Monday 23:01:18 Sunday
  5. Elapsed: 00:00:00. 00
  6. Duzz $ scott @ orcl>SelectSysdate, to_char (sysdate,'Day') Weekday, next_day (sysdate, 2) n_day, to_char (next_day (sysdate, 2 ),'Day') N_weekdayFromDual;
  7. Sysdate weekday N_DAY N_WEEKDAY
  8. -----------------------------------------------------------
  9. 23:04:26 Monday 23:04:26 Monday
  10. Elapsed: 00:00:00. 00
  11. Duzz $ scott @ orcl>SelectSysdate, to_char (sysdate,'Day') Weekday, next_day (sysdate, 3) n_day, to_char (next_day (sysdate, 3 ),'Day') N_weekdayFromDual;
  12. Sysdate weekday N_DAY N_WEEKDAY
  13. -----------------------------------------------------------
  14. 23:04:55 Monday 23:04:55 Tuesday
  15. Elapsed: 00:00:00. 00
  16. Duzz $ scott @ orcl>SelectSysdate, to_char (sysdate,'Day') Weekday, next_day (sysdate,'Monday') N_day, to_char (next_day (sysdate,'Monday'),'Day') N_weekdayFromDual;
  17. Sysdate weekday N_DAY N_WEEKDAY
  18. -----------------------------------------------------------
  19. 23:08:16 Monday 23:08:16 Monday
  20. Elapsed: 00:00:00. 00
  21. Duzz $ scott @ orcl>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.