先看数据表:
首先找出每个学生的课程数
select name,COUNT(kem) as nums from xresult where result>60 group by name --找出大于60分学生课程门数 select name, COUNT(kem)as nums from xresult group by name ---找出学生所有课程门
那么就可以给两个表进行,左右连接,当大于60的课程,和它所有的课程相等时候,那么这位学当然就满足条件
select A.name from( select name,COUNT(kem) as nums from xresult where result>60 group by name )A inner join( select name, COUNT(kem)as nums from xresult group by name )as B on A.nums=B.nums and A.name=B.name
当然实现功能可能还有很多!