MySQL filters out data that is in one table but not in another table

Query for those who did not fill in the "Complete in Group List" but have a student ID in the "Course Selection List"

SELECT * FROM `选课名单` 
WHERE 
    NOT  EXISTS  ( 
        SELECT `学号` 
        FROM `分组填写名单` 
        WHERE `选课名单`.`学号` = `分组填写名单`.`学号` );

Guess you like

Origin blog.csdn.net/weixin_44575911/article/details/110183480