Mode |First day of week |Range |Week 1 is the first week … 
-----+------------------+------+-------------------------------
0    |Sunday            | 0-53 |with a Sunday in this year 
1    |Monday            | 0-53 |with more than 3 days this year 
2    |Sunday            | 1-53 |with a Sunday in this year 
3    |Monday            | 1-53 |with more than 3 days this year 
4    |Sunday            | 0-53 |with more than 3 days this year 
5    |Monday            | 0-53 |with a Monday in this year 
6    |Sunday            | 1-53 |with more than 3 days this year 
7    |Monday            | 1-53 |with a Monday in this year 
假设1月1日是周三,你觉得这一年的第一周从哪一天开始?? 一周从星期几开始?

解决方案 »

  1.   

    由于不同的国家,不同的公司对一年的第一周从哪儿开始的约定并不相同。所以MYSQL在提供这个函数的时候,提供了一个参数,让你来决定。
    如果你使用参数 0, 则以本年的第一个周日开始算为第0周。建议楼主直接在MYSQL中试一下这些参数,看看函数返回的结果是什么,以帮助理解。