Home  >  Article  >  Database  >  How to use YEARWEEK function in MySQL

How to use YEARWEEK function in MySQL

WBOY
WBOYforward
2023-05-30 21:22:041651browse

YEARWEEK(date): Get the year and week of the date

SELECT YEARWEEK(SYSDATE()) 
SELECT YEARWEEK(‘2015-01-10') 
SELECT YEARWEEK(‘2015-01-10',1)
-> 201602
-> 201501
-> 201502

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