Home  >  Article  >  Database  >  How to use the MONTH function in MySQL

How to use the MONTH function in MySQL

王林
王林forward
2023-05-27 18:43:061522browse

MONTH(date)

SELECT MONTH(‘2016-01-16') 
SELECT MONTH(‘2016-01-16 00:00:00')
-> 1 (表示返回date是当年的第几月,1月就返回1,... ,12月就返回12)

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