Home >Database >Mysql Tutorial >How to use DAYOFWEEK in MySQL

How to use DAYOFWEEK in MySQL

PHPz
PHPzforward
2023-05-30 16:25:061435browse

DAYOFWEEK(date)

SELECT DAYOFWEEK(‘2016-01-16') 
SELECT DAYOFWEEK(‘2016-01-16 00:00:00')
-> 7 (表示返回日期date是星期几,记住:星期天=1,星期一=2, ... 星期六=7)

The above is the detailed content of How to use DAYOFWEEK 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