--AAAA 表有,BBBB 表没有的 select * from AAAA a where not exists( select 1 from BBBB where xuliehao=a.xuliehao and jiaokuan=a.jiaokuan and ....) --BBBB 表有,AAAA 表没有的 select * from BBBB a where not exists( select 1 from AAAA where xuliehao=a.xuliehao and jiaokuan=a.jiaokuan and ....)
--AAAA 表有,BBBB 表没有的
select * from AAAA a
where not exists(
select 1 from BBBB
where xuliehao=a.xuliehao
and jiaokuan=a.jiaokuan
and ....)
--BBBB 表有,AAAA 表没有的
select * from BBBB a
where not exists(
select 1 from AAAA
where xuliehao=a.xuliehao
and jiaokuan=a.jiaokuan
and ....)