如果两表结构不同的话可以select具体的字段:
倒是可以优化一下的:
with temp as (select a.sp from a, b where a.ck=b.ck and a.sp=b.sp)
select * from a where sp not in (select sp from temp) union select * from b where sp not in (select sp from temp)
select * from a where sp not in (select a.sp from a, b where a.ck=b.ck and a.sp=b.sp)) union select * from b where sp not in (select a.sp from a, b where a.ck=b.ck and a.sp=b.sp))