SQL>select*from a; A BB ----------- a 1 a 2 b 1 b 2 b 3 a 3 已选择6行。 SQL>select*from b; A BB ----------- a 1 a 2 b 1 b 2 SQL>select*from a 2 minus 3select*from b; A BB ----------- a 3 b 3
假设你的两个字段名为name和id select a.* from a表 a left join b表 b on a.name=b.name and a.id=b.id where b.id is NULL and b.name is NULL;