SELECT * FROM TableName WHERE DATEDIFF(mm, 日期字段, GETDATE()) = 0
SELECT * FROM 表名 WHERE DATE_FORMAT(时间字段名, ‘%Y%m’ ) = DATE_FORMAT( CURDATE() , ‘%Y%m’ ) SELECT * FROM TableName WHERE DATEDIFF(mm, 日期字段, GETDATE()) = 0; select * from tableName where datediff(month, 字段名,getdate())=0 |