Mysql method to query the month in the date: execute the [SELECT * FROM BLOG WHERE MONTH(CREATETIME)=7;] statement.
Get the month
(Recommended tutorial: mysql tutorial)
SELECT * FROM BLOG WHERE MONTH(CREATETIME)=7;
Get the year
SELECT * FROM BLOG WHERE YEAR(CREATETIME)=7;
Related recommendations: php training
The above is the detailed content of How to query the month in a date in mysql. For more information, please follow other related articles on the PHP Chinese website!