补齐上篇查询一年中每个月数据,某月份数据为空补0问题(MySql)

一、查询一年中每个月数据,某月份数据为空补0html SELECT sum(case DATE_FORMAT(日期字段,'%m') when '01' then 1 else 0 end) as 一月, sum(case DATE_FORMAT(日期字段,'%m') when '02' then 1 else 0 end) as 二月, sum(case DATE_FORMAT(日期字段,'%m'
相关文章
相关标签/搜索