select *
from (select t,
dictinstrumenttestid,
dictinstrumentid,
dicttestitemid,
analyzercode,
factor,
testtype,
isdilution,
isqc,
count(*) over(partition by dictinstrumenttestid, dictinstrumentid, dicttestitemid, analyzercode, factor, testtype, isdilution, isqc) f
from (select t1.*, 't1' t
from dictinstrumenttest t1
union all
select t2.*, 't2' t
from listest.dictinstrumenttest t2) t
order by dictinstrumenttestid, dictinstrumentid) tt
where tt.f = 1
from (select t,
dictinstrumenttestid,
dictinstrumentid,
dicttestitemid,
analyzercode,
factor,
testtype,
isdilution,
isqc,
count(*) over(partition by dictinstrumenttestid, dictinstrumentid, dicttestitemid, analyzercode, factor, testtype, isdilution, isqc) f
from (select t1.*, 't1' t
from dictinstrumenttest t1
union all
select t2.*, 't2' t
from listest.dictinstrumenttest t2) t
order by dictinstrumenttestid, dictinstrumentid) tt
where tt.f = 1