判断类似一个班级的男生和女生的人数,用sum (cese when then )
 
 
select count(er.execute_result),  
sum(case er.execute_result   when 1 then  1  else  0 end) completed,  
sum(case er.execute_result    when 0 then     1    else    0   end) notCompleted  
  from taw_wp_execute_result er ;  

 

 
 
 
select   
(case when er.execute_result>0 then 'a'  
 else 'b'  
  end   
)  
from taw_wp_execute_result er ;