1.导入别的表
insert into EMPI_IDENTIFY select id,empiid, name||':' ||idcardno,'accidcardno','' from empi_main where empi_state ='正常';
insert into EMPI_IDENTIFY
select sys_guid(),empiid, name||':' ||tel,'acctel','' from empi_main where empi_state ='正常' and tel is not null;
2.
delete
FROM empi_cross where id in(
SELECT id from (
SELECT ROW_NUMBER()
OVER(PARTITION BY t.linkempiid ORDER BY t.linkempiid) rn,
t.*
FROM empi_cross t
)
WHERE rn = 2
)