第一个:至少选修c1和c2的学生编号
1. select sno from sc where sc.cno='c1' and sno in(select sno from sc where cno='c2')
2.select sno from sc scx,sc scy where scx.sno=scy.sno and scx.cno='c1' and scy.cno='c2'
第二个:同时选修c1和c2的学生编号
select sc.sno from sc where sc.cno = 'c1' intersect select sc.sno from sc where sc.cno= 'c2';
转载于:https://www.cnblogs.com/sunshine-study/p/3645657.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)