select *
from table_name
where
DATE_FORMAT(table_name.field,'%Y-%m') >
DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m');
查询最近12个月的数据SQL语句
最新推荐文章于 2024-01-11 16:25:18 发布
select *
from table_name
where
DATE_FORMAT(table_name.field,'%Y-%m') >
DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m');