大家看看这个查询如何写

大家看看这个查询怎么写?查询“至少选修了学号为109的学生选修的全部课程的学生号”[解决办法]SQL codeselec

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



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

[解决办法]

SQL code
select a.snofrom score ainner join (select cno from score where sno='109') bon a.cno=b.cno and a.sno<>'109'group by a.snohaving count(*)>=(select count(*) from (select cno from score where sno='109'))