mysql 按类型查询个数和总数

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;


原文地址:https://www.cnblogs.com/wcnwcn/p/9181791.html