SELECT STUDENT_ID FROM CHENGJI GROUP BY STUDENT_ID, COURSE_ID HAVING SUM(TRUNC(SCORE / 80)) = COUNT(1);
select sid from students where not exists (select 1 from (select sid from scores where score<=80 and scores.sid=students.sid))
select name from table where name not in (select distinct(name) from table where 分数 <= 80 )
我也来凑热闹,2,3楼都写的很好,两种思想,不过2楼有点缺陷,如果总分不是100分满分,那就有可能不符合了。 我也写个跟2,3楼思想不同的方法:求其中最小的成绩,如果这个成绩也大于80分,那该学生就满足条件。 select student_id from (select student_id, min(score) as min_score from score group by student_id) where min_score > 80
再补充一种方法: select student_id, score from (select student_id, score, rank() over(partition by student_id order by score) cc from score) where cc = 1 and score >= 80
简写一下select student_id, min(score) as min_score from score group by student_id having min(score) > 80今天才知道怎么用插入各种源代码。
select student_id, min(score) as min_score from score group by student_id having min(score) > 80 这个不错
就这么简单!select sno from SC group by sno having min(score)>=80
FROM CHENGJI
GROUP BY STUDENT_ID, COURSE_ID
HAVING SUM(TRUNC(SCORE / 80)) = COUNT(1);
(select distinct(name) from table where 分数 <= 80 )
我也写个跟2,3楼思想不同的方法:求其中最小的成绩,如果这个成绩也大于80分,那该学生就满足条件。
select student_id
from (select student_id, min(score) as min_score
from score
group by student_id)
where min_score > 80
from (select student_id,
score,
rank() over(partition by student_id order by score) cc
from score)
where cc = 1
and score >= 80
from score
group by student_id
having min(score) > 80今天才知道怎么用插入各种源代码。
from score
group by student_id
having min(score) > 80
这个不错
from SC
group by sno
having min(score)>=80
两种理解:
1.每一门功课的成绩都>80
6楼答案
2.任意一门功课的成绩>80