SELECT WEEK("2017-01-01", 1);
SELECT WEEK("2018-01-01", 1);
Mode 1:
First day of week: Monday
Range: 0-53
Week 1 is the first week … with 4 or more days this year
For mode values with a meaning of “with 4 or more days this year,” weeks are numbered according to ISO 8601:1988:
- If the week containing January 1 has 4 or more days in the new year, it is week 1.
- Otherwise, it is the last week of the previous year, and the next week is week 1.