select a.xm,a.xb,a.bj,b.kcmc,b.cj from student a inner join score b on a.xm=b.xm and b.cj>=60

解决方案 »

  1.   

    select a.xm,a.xb,a.bj,b.kcmc,b.cj from student a , score b where a.xm=b.xm and b.cj>=60
      

  2.   

    楼上两位误解我的意思了应该
    我是说从基本信息表student中找出这样符合条件的人
    应该怎么办呢?
      

  3.   

    好像不难吧SELECT * FROM student WHERE NOT xm IN
    (SELECT xm FROM score WHERE cj<60)
      

  4.   

    SELECT * FROM student WHERE xm NOT IN
    (SELECT xm FROM score WHERE cj<60)
      

  5.   

    SELECT * FROM student WHERE xm NOT IN
    (SELECT xm FROM score WHERE cj<60)
      

  6.   

    select * from student where xm not in(select distinct(t.xm) from score t where t.cj<60)
      

  7.   

    select * from student
    where xm in(select xm from score
                group by xm
                having min(cj)>=60)
    order by bj
      

  8.   

    select * from student aa
    where not exists(select * from score where cj<'60' and xm=aa.xm)
      

  9.   

    declare @score table(xm varchar(10),kc varchar(10),cj varchar(10))
    insert @score select '张三','英语' ,'60'
    insert @score select '张三','语文',' 80'
    insert @score select '张三',' 数学','55'
    insert @score select '李四' ,'英语','60'
    insert @score select '李四', '语文', '60'
    insert @score select '李四', '数学', '60'select * from @score where xm not in(select xm from @score where cj<60)
      

  10.   

    to hanyefei ():
    楼主,好像是我第一个说出来的啊。
    一分都没有,很不给面子吧!