英语
vfp 统计满足条件的个数我有cj.dbf(成绩表),其部分字段是bj(班级),yw(语文),sx(数学),yy(英语)等学科名,现我求他们的及格人数.sele bj,count(yw) from cj where yw>=90 group by bj &&输出是各班级的语文及格人数但我需要把语文,英语等学科的及格人数都算出来该如何写?现我写成sele bj,count(yw),count(sx) from cj where yw>=90,sx>=90 group by bj但提示命令含不能识别的短语或关

2019-04-03

vfp 统计满足条件的个数
我有cj.dbf(成绩表),其部分字段是bj(班级),yw(语文),sx(数学),yy(英语)等学科名,现我求他们的及格人数.
sele bj,count(yw) from cj where yw>=90 group by bj &&输出是各班级的语文及格人数
但我需要把语文,英语等学科的及格人数都算出来该如何写?
现我写成sele bj,count(yw),count(sx) from cj where yw>=90,sx>=90 group by bj但提示命令含不能识别的短语或关键字.
优质解答
select t.bj,t.语文,b.数学 from ;
(select bj,count(yw) as 语文 from cj where yw > 90 group by bj) t ;
left join ;
(select bj,count(sx) as 数学 from cj where sx > 90 group by bj) b ;
on t.bj = b.bj
select t.bj,t.语文,b.数学 from ;
(select bj,count(yw) as 语文 from cj where yw > 90 group by bj) t ;
left join ;
(select bj,count(sx) as 数学 from cj where sx > 90 group by bj) b ;
on t.bj = b.bj
相关标签: 统计 个数 班级 语文 数学 英语 学科
相关问答