select Student_ID from Score group by Student_ID having min(score)>80

解决方案 »

  1.   

    select Student_ID from Score group by Student_ID having min(score)>=80楼主的意思应该包含80分吧,呵呵
      

  2.   

    请问  NinGoo(宁哥)
    having 是什么含义
      

  3.   

    having相当于where,不过在group by后面不能用where只能用when
      

  4.   

    写错了,不过在group by后面不能用where只能用having。呵呵
      

  5.   

    这样写也可以select id from table3 where  id not  in
    (select id from table3 where score<80)
      

  6.   

    上面忘记加distinct了,下午上课没来得及说,现在补上,呵呵
    select distinct id from table3 where  id not  in
    (select id from table3 where score<80)
    至于效能,第一个语句只需要一次扫描,第二局需要2次扫描,我认为还是第一句好一点,呵呵
      

  7.   

    select Student_ID from Score group by Student_ID having min(score)>=80好象不行吧?斑竹试了这条语句没有?
      

  8.   

    sorry ! 口误。
    楼主试了没?
      

  9.   

    试了,可以。
    谢谢大家,尤其感谢NinGoo(宁哥)