select A.calssno, A.count_1, B.count_2, C.count_3
from
(select count(*) as count_1, calssno
from student_mart
where project = '语文'
and mark = 'D'
group by calssno) A,
(select count(*) as count_2, calssno
from student_mart
where project = '数学'
and mark = 'D'
group by calssno) B,
(select count(*) as count_3, calssno
from student_mart
where project = '英语'
and mark = 'D'
group by calssno) C
where A.calssno = B.calssno
and B.calssno = C.calssno