第四章上机

来源:互联网 发布:redhat centos 编辑:程序博客网 时间:2024/06/07 17:08
----------上机3  Not In 关键字   ----使用not in 关键字的子查询来查询为参加‘’ 的课程最近一次考试的再读学生名单   select studentname from student as stu,result as res where stu.StudentNo=res.StudentNo and     examdate not in (select max(examdate) from result     where subjectid=(select subjectid from subject where subjectname='基于.NET平台的软件系统分层开发') )    ---上机4--------有错误_返回多个语句  用in(可以了)    if exists (select gradename from grade where gradeID in(select gradeid from student where gradeid=1))    begin    update student set gradeid=2 where gradeID in(select gradeid from student where gradeid=1)     end  

0 0
原创粉丝点击