SQL 练习37

  • 检索至少选修两门课程的学生学号
SELECT  Student.SId,Student.Sname,选课数 from Student,
(SELECT sid,COUNT(cid) 选课数  from sc GROUP BY sid HAVING COUNT(cid)>=2) t
WHERE Student.SId = t.sid

image

posted @ 2021-08-20 20:19  弩哥++  阅读(27)  评论(0编辑  收藏  举报