mysql 按类型分组 查询状态的个数和总数
SELECT file_type,sum(data_count) total ,sum(case Load_status when 1 then data_count else null end) success ,sum(case Load_status when 0 then data_count else null end) fail from qarc_file_load GROUP BY file_type;
mysql 按类型分组 查询状态的个数和总数
SELECT file_type,sum(data_count) total ,sum(case Load_status when 1 then data_count else null end) success ,sum(case Load_status when 0 then data_count else null end) fail from qarc_file_load GROUP BY file_type;