EXCEPT ALL equivalent in MySQL

后端 未结 3 1535
刺人心
刺人心 2021-01-24 01:03

So I have a table called members and another table called group.The leader of the group is also a member

To retrieve members,who are not leaders I did the following code

3条回答
  •  遇见更好的自我
    2021-01-24 01:18

    You can try with this scenario.

    SELECT 
            r.col1,r.col2 
    FROM    tabel1 r 
    WHERE ROW ( r.col1,r.col2 ) NOT IN( 
                                  SELECT 
                                      col1,col2 
                                  FROM tabel2 
                                  );
    

提交回复
热议问题