问题:将一张表中的数据,按照某种条件插入到另外一张表中。
思路:原表为:A,目标表:B
可以A表中满足条件的数据加工成一条SQL,再通过执行这些SQL,实现插入数据。
例如:select 'insert into tab16(storeid,relateddoctypeid,relateddocstoreid,canonical,alias,fullname,orgid)'| |' values(global.storeid_sequence.nextval,2,' || t2.storeid || ',''部门收文岗'',''部门收文岗'',''部门收文岗/' || t2.fullname || ''',1);'
from tab2 t2 where relateddocstoreid in (select storeid from tab2 where storeid=1)
按条件插入多条数据
最新推荐文章于 2024-08-29 09:53:29 发布