数据库提oracle 一张成绩表(里面有三个字段 姓名,学科,成绩) 求显示所有学科均及格的同学名字。

2025年03月13日 05:28
有3个网友回答
网友(1):

select 姓名
from 成绩表
group by 姓名
having count(case when 成绩<60 then 1 end)=0
或者
select 姓名
from 成绩表
where 姓名 not in (select 姓名 from 成绩表 where 成绩<60)

网友(2):

select 姓名 from 表 group by 姓名 having avg(成绩) >=60

网友(3):

select * from test where name not in(select name from test where score>=60 group by name)