MSSQL
查询2020年的每个月的工单量,其它修改年份即可:
select DATEPART(mm, DATEADD(s,CREATEDTIME/1000,'19700101') ) as '月份',count(WORKORDERID)as '工单量' from WorkOrder where DATEPART(yy, DATEADD(s,CREATEDTIME/1000,'19700101') )=2020 group by DATEPART(mm, DATEADD(s,CREATEDTIME/1000,'19700101') );