Mysql 根据某字段分类查询各类数量
1、统计总数量以及某字段分类数量SELECTCOUNT( CASE WHEN p.run_status = 0 THEN 1 END ) AS tjsp,COUNT( CASE WHEN p.run_status = 1 THEN 1 END ) AS cdsp,COUNT( CASE WHEN p.run_status = 2 THEN 1 END ) AS fdsp,COUNT( CASE WHEN p.run_status = 3 THEN 1 END ) AS djsp,COUNT( C
原创
2020-05-22 14:34:49 ·
2689 阅读 ·
0 评论