如何在MySQL日期中提取月份和年份并进行比较?

如何从mySQL日期中提取月份和日期并将其与另一个日期进行比较?

我发现这个MONTH()但它只获得了一个月.我寻找一个月和一年.

在Mysql Doku中:
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_extract

SELECT EXTRACT( YEAR_MONTH FROM `date` ) 
FROM `Table` WHERE Condition = 'Condition';
https://stackoverflow.com/questions/7830987/how-do-i-extract-month-and-year-in-a-mysql-date-and-compare-them

转载注明原文:如何在MySQL日期中提取月份和年份并进行比较?