I have query, help me rewrite it for SQL Server:
insert into swi (co, na, ci, ac, id, version, add)
select co, na, ci, acc, id, ?, address
from swi_tmp
where co||me not in (select co||me from swi)
Now, I have, but it still not working
insert into swi (co, na, ci, ac, id, version, add)
select co, na, ci, acc, id, ?, address
from swi_tmp
where not exists (select 1
from swi_tmp
where swi_tmp.co = swi.co and swi_tmp.na = swi.na)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…