日期:2014-05-18  浏览次数:20463 次

大家看看这个查询怎么写?



查询“至少选修了学号为109的学生选修的全部课程的学生号”

------解决方案--------------------
SQL code

select a.sno
from score a
inner join 
(select cno from score where sno='109') b
on a.cno=b.cno and a.sno<>'109'
group by a.sno
having count(*)>=
(select count(*) from
 (select cno from score where sno='109'))