您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Oracle >> Oracle如何循环插入数据到新表中

Oracle如何循环插入数据到新表中

来源:网络整理     时间:2018/1/22 2:00:30     关键词:

关于网友提出的“ Oracle如何循环插入数据到新表中”问题疑问,本网通过在网上对“ Oracle如何循环插入数据到新表中”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: Oracle如何循环插入数据到新表中

解决方案1:

 


 insert into tmp20171110_empjoinrec
    values
      ((s_pfm_recid.nextval),
       (select t.employee_id
          from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
         where t2.code = t.employee_code),
       (select t.employee_name
          from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
         where t2.code = t.employee_code),
         (select t2.joindate
          from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
         where t2.code = t.employee_code),
         (select t.dept_one
          from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
         where t2.code = t.employee_code),
         (select t.identity_code
          from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
         where t2.code = t.employee_code),
       null);
  
   
改成:

insert into tmp20171110_empjoinrec
select s_pfm_recid.nextval,
   t.employee_id,
   t.employee_name,
   t2.joindate,
   t.dept_one,
   t.identity_code,
   null
  from tmp20171110_empbaseinfo t, tmp20171110_12725958_01 t2
 where t2.code = t.employee_code;  

再试试看。
  • 数据结构实习1.4 双向循环链表实现长整数加减

以上介绍了“ Oracle如何循环插入数据到新表中”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/4531794.html

相关图片

相关文章