天天看点

– 12、查询至少有一门课与学号为“01“的同学所学相同的同学的信

– 12、查询至少有一门课与学号为"01"的同学所学相同的同学的信

SELECT st.*
FROM
student st
WHERE st.s_id IN(
SELECT
DISTINCT sc.s_id
FROM score sc
WHERE
sc.c_id IN (
SELECT sc.c_id
FROM score sc
WHERE sc.s_id = '01'))