-- 9、查詢學過編號為“01“並且也學過編號為“02“的課程的同學的資訊

Ele_sorriu發表於2020-10-04
SELECT 
st.*
FROM student st 
INNER JOIN score sc ON sc.s_id=st.s_id  AND sc.c_id='01'
WHERE st.s_id IN (
SELECT 
st2.s_id
FROM student st2
INNER JOIN score sc2 ON sc2.s_id=st2.s_id AND sc2.c_id='02'
)

相關文章