How to use WEEK function in MySQL
This article mainly introduces how to use the WEEK function in MySQL, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.
WEEK (date,index)
SELECT WEEK ('2016-01-03') SELECT WEEK ('2016-01-03, 0) SELECT WEEK (' 2016-01-03, 1)-> 1 (this function returns the week ordinal of date, date (01.03) is Sunday, the default is Sunday as the first day of the week, the function returns 1 here can be understood in two ways: 1, return 0 in the first week, return 1 in the second week. 2. Start counting with the full week of the year. The first week returns 1, the second week returns 2, and the last week returns 53)-> 1 (the default index of week () is 0. So the results are the same as above)-> 0 (when index is 1, the first day of the week is Monday, so Monday the 4th is the beginning of the second week.) Thank you for reading this article carefully. I hope the article "how to use the WEEK function in MySQL" shared by the editor will be helpful to you. At the same time, I hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!