摘要: 查询选修了所有课程的学生的学号,姓名,年龄select sno,sname,datediff(YYYY,birthdate,getdate()) 年龄from studentwhere not exists(select * from course where not exists(select * from sc where sno=student.sno and SC.CNo=course.cno));这个查询,查出的是选择全部课程的学生的姓名。对于这个语法,要分步理解,从最下边的where看起,从下往上去看。最下边的一个select(not exists后边)是把学生编号和课程编号... 阅读全文
posted @ 2012-04-26 16:48 superqbb 阅读(704) 评论(0) 推荐(0) 编辑