当前月份往前推12个月份的数据信息。
select DATE_FORMAT(cwo.create_time, '%Y-%m') as createDate,
count(case when (cwo.process_method_code = 1 or cwo.process_method_code = 2) then 1 END) as hdCount,
count(case when cwo.process_method_code = 3 then 1 END) as siteCount
from ccs_work_order cwo
group by createDate
order by createDate desc
limit 12
结果展示:
因篇幅问题不能全部显示,请点此查看更多更全内容