student表少了一个字段 
class  所在班级--------------------华丽的分割线---------------------------
class表(班级表)  
cid 主键 
cname  班级名字 
cstate  班级状态(正常、毕业.....) student表(学生表) 
sid 主键 
sname  学生姓名 
class  所在班级

解决方案 »

  1.   

    delete from student a
    where exists(select class from class where cstate='finish' and class=a.class)delete from student
    where cstate='finish' 
      

  2.   

    DELETE A FROM STUDENT A, CLASS B WHERE A.CLASS=B.CID AND B.CSTATE='毕业'DELETE CLASS WHERE CSTATE='毕业'
      

  3.   


    declare @class as intselect @class = n.class from class m , student n where m.cid = n.class and m.cstate <> '毕业' delete from student where sid = @class
    delete from class where cid = @class
      

  4.   


    不是你理解错了 而是我的问题没有那么复杂 
    student表里的字段也没有那么多  呵呵 
    还是谢谢你