select
a.classno, sum(a.a) 不及格 from
( select classno, case when grade<80 then 1 else 0 end a from stscore where course ='English' ) a
group by a.classno
你在where里面都过滤掉了还怎么展示