有一个test数据库,里面有一张学员表student,有三个字段,calss,name,score,分别代表班级,姓名,成绩

查询每个班级的几个人数和不及格人数,输出格式是 class,及格人数,不及格人数

select class,

(select count(*) from student where class="stu".class and score>=60) jige,
(select count(*) from student where class="stu".class and score<60) bujige
from student stu group by class

 

//性能上,不知道怎么样。

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-09-02
猜你喜欢
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
相关资源
相似解决方案