SQL面试50题-27
27、 查询出只有两门课程的全部学生的学号和姓名(不重点)
SELECT st.s_id ,st.s_name FROM Student st INNER JOIN Score sc ON sc.s_id = st.s_id GROUP BY st.s_id HAVING COUNT(st.s_id) = 2
27、 查询出只有两门课程的全部学生的学号和姓名(不重点)
SELECT st.s_id ,st.s_name FROM Student st INNER JOIN Score sc ON sc.s_id = st.s_id GROUP BY st.s_id HAVING COUNT(st.s_id) = 2
相关推荐