22,207
社区成员
发帖
与我相关
我的任务
分享
select
x,x,x,x
from 表1 t1
full join 表2 t2 on 表1.核对码=表2.核对码 and 表1.名称=表2.名称
where t1.核对码 is null or t2.核对码 is null
这样应该能满足你的需求,只是查询效率估计不怎么样
select
T.*
from
(
select
t.1*
row_number() over(partition by t.名称,t.核对码 order by (select 1)) as de
from
(
select 名称,核对码 from 表1
union all
select 名称,核对码 from 表2
)t1
)T
where T.de >1