56,679
社区成员
发帖
与我相关
我的任务
分享
select count(case_id) as count,case_id from test_problem GROUP BY case_id;
select count(case_id) as count,case_id from test_problem where solve_state='1' GROUP BY case_id;
select count(case_id) as count,case_id from test_problem where solve_state='0' GROUP BY case_id;
select IFNULL(t2.count,0),t2.case_id from test_problem t1 LEFT JOIN
(select count(case_id) as count,test_problem.case_id from test_problem where solve_state='1' GROUP BY case_id) t2
on t1.case_id=t2.case_id;