select to_char(日期字段,"mm") mon,count(*) num
from 表名 t
where to_char(日期字段,"yyyy")="2017"
group by to_char(日期字段,"mm")
order by mon