有一个test数据库,里面有一张学员表student,有三个字段,class,name,score,分别表示班级,姓名,成绩,问:查询每个班级的及格人数和不及格人数,输出格式是class,及格人数,不及格人数
这个该怎么写呢?
如今有越来越多的人在网上做代驾,打造一个代驾平台,既可以让司机增加一笔额外的收入,也解决了车主酒后不能开发的问题,汉潮代驾系统基于微信小程序开发的代驾系统支持一键下单叫代驾,支持代驾人员保证金功能,支持代客下单,支持代驾人员订单调度及代驾人员位置查看,欢迎大家关注我们。 汉潮代驾系统是汉潮唐越科技有限公司研发团队自主开发的代驾系统,包含后台系统和微信小程序,主要功能模块商家设置,会员管理,营销管理
0
select class,sum(case score >=60 then 1 else 0 end) as '及格人数',sum(case score < 60 then 1 else 0 end) as '不及格人数'from student group by class
select class,(select count(*) from student where class=stu.class and score >=60 ) as '及格人数',(select count(*) from student where class=stu.class and score <60 ) as '及格人数',from student stu group by class
哦,写错了。更正:
select class,(select count(*) from student where class=stu.class and score >=60 ) as '及格人数',(select count(*) from student where class=stu.class and score <60 ) as '不及格人数',from student stu group by class
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号