(oracle 查询和“s001”号的同学学习的课程完全相同的其他同学学号和姓名;)
查询和“s001”号的同学学习的课程完全相同的其他同学学号和姓名;
select a.sno,a.sname from student a, (select sno, cno from sc where sno = 's001') b, sc c
where c.cno = b.cno
and a.sno <> 's001'
and a.sno = c.sno
and (select count(1) from sc where cno = b.cno)=3;
建议最好手打,粘贴容易出错。