`

找出课程分数都大于80分的学生姓名

 
阅读更多



 

 select a.name from class a left join 
( select name  from class where fenshu < 80 ) b on a.name = b.name where b.name is null group by a.name


select t1.name from 
(select name ,count(*) n from class where fenshu>=80 group by name  ) t1
,(select name ,count(*) n from class group by name) t2
where t1.name=t2.name and t1.n=t2.n
 
 
select * from ( select * from (select * from class order by fenshu asc ) temp group by name ) tem 
where tem.fenshu > 80 
 
 
 select name , min(fenshu) from class  group by name HAVING min(fenshu)>80 
 
 
  • 大小: 18.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics