-- 思路想了挺久的,这个思路是,课程数量和1号同学相同,并且没有同学一没有的课程。这样的同学与同学一选课相同
select *
from Student
where sid in(
select sid
from sc
group by sid
having count(cid)=3
-- 这个地方可以查
)
and sid not in(
select distinct sid from sc where cid
not in(
select cid from sc where sid = 01
)
)
and sid <> 1
查询和“ 01 “号的同学学习的课程完全相同的其他同学的信息
最新推荐文章于 2023-07-24 17:24:12 发布