Home  >  Article  >  Database  >  How to use WEEKDAY in MySQL

How to use WEEKDAY in MySQL

WBOY
WBOYforward
2023-05-28 21:04:041640browse

WEEKDAY(date)

SELECT WEEKDAY(‘2016-01-16') 
SELECT WEEKDAY(‘2016-01-16 00:00:00')
-> 5 (表示返回date是在一周中的序号,西方日历中通常一周的开始是星期天,并且以0开始计数,所以,记住:0=星期一,1=星期二, ... 5=星期六)

The above is the detailed content of How to use WEEKDAY in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete