select distinct 选课表.学生号 from 选课表 as b,
       (select 选课表.课程号 as 课程号 
           from 选课表 where 选课表.学生号 = '001') as a
    where b.课程号=a.课程号

解决方案 »

  1.   

    create table student(studentno char(10),name char (10))
    create table course(courseno char(10),coursename char (10))
    create selectcourse(courseno char(10),studentno char(10))
    以上为创建表头
    insert student(studentno,name) into value (XX,XX)
    insert course(courseno,coursename) into value (XX,XX)
    insert selectcourse(courseno,studentno) into value (XX,XX)
    以上为插入数据
    select student.studentno
    from student ,course ,selectcourse 
    where student.studentno=selectcourse.studentno 
             and  selectcourse.courseno  in all(
          select courseno
          from selectcourse,student 
          where  student.studentno=selectcourse.studentno
                 and student.studentno='01')
    以上为选择 至少选了一号学生全部课程的所有学生序号
    01为1号学生的序号                      
      

  2.   

    all是干吗用的?
    好像还是不对
      

  3.   

    我试了一下
    在all处报错