case when
用sum而不是count
select sum(case when score<60 then 1 else null end) bujige,
sum(case when score>=60 and score<80 then 1 else null end) jige,
sum(case when score>=80 then 1 else null end) youxiu
from t_student_socre
case when
用sum而不是count
select sum(case when score<60 then 1 else null end) bujige,
sum(case when score>=60 and score<80 then 1 else null end) jige,
sum(case when score>=80 then 1 else null end) youxiu
from t_student_socre