急,急,急 pl/sql ,oracle 根据查询结果统计数量

2022-08-12 教育 48阅读
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
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com