oracle数据库,获取当前月https://www.cnblogs.com/webttt/p/7803830.html
select to_char(sysdate, 'MM' )-1 from dual
select * from 表名称
where year ='2022'
and month<='06'
如果是参数的话
where year ='${year_code}'
and month<='${month_code}'
1、当月
year*100+month=datepart(year,getdate())*100+datepart(month,getdate())
2、今年当月之前
year=datepart(year,getdate()) and month<datepart(month,getdate())