oracle sql 数据库之间导入数据

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
    )

 

 

 
posted @ 2019-05-21 21:25  leolzi  阅读(371)  评论(0编辑  收藏  举报