表查询

有一张成绩表,不同学生考试的课程可能是不同的,求一句SQL找出每门课大于90分的学

表名 :t
列名:姓名,课程名称,分数

 

SQL1:
select name from test.stu
group by name
having count(score) =sum(case when score>90 then 1 else 0 end )

SQL2:
select name from stu
group by name
having name not in (
select name from stu
where score <90)

SQL3:
select name from test.stu
group by name
having min(score)>=90

posted @ 2017-10-17 10:35  dieyaxianju  阅读(128)  评论(0编辑  收藏  举报