mysql 按类型查询个数和总数

时间:2024-03-06 11:44:01
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;