SELECT case when substr('${period}',6,2)=12 then TO_CHAR(ADD_MONTHS(TO_DATE((substr('${period}',1,4))||'-'||'01', 'yyyy-MM'), ROWNUM - 1), 'yyyy/MM')
else
TO_CHAR(ADD_MONTHS(TO_DATE((substr('${period}',1,4)-1)||'-'||(substr('${period}',6,2)+1), 'yyyy-MM'), ROWNUM - 1), 'yyyy/MM')
end 月份 FROM DUAL
CONNECT BY ROWNUM <= 12
参数写 2021-12 你可以参考下这个