select bm from a
union
select sfzbm from b
minus
(select bm from a,b where a.bm=b.sfzbm);
用表链接
select * from A where bm not in (select bm from B)
两张表都有姓名吗?
select dm from A except(select sfzbm from B)
select bm from A where bm not in (select sfzbm from B)
union all
select sfzbm from B where sfzbm not in (select bm from A)