(小笔记)()Oracle 批量复制一个数据表的数据,修改部分字段后追加加入到数据表中


insert into jwxt.jy_zyxx a (a.jxjhh,
  a.ssxqdm,
  a.nj,
  a.zydm,
  a.xklbdm,
  a.rs,
  a.bjs,
  a.zskcs,
  a.zdbyxf,
  a.ggbxxf,
  a.ggxxxf,
  a.xkbxxf,
  a.xkxxxf,
  a.zybxxf,
  a.zyxxxf1,
  a.zyxxxf2,
  a.sjkxf,
  a.fssjxf,
  a.jqsjxf,
  a.yyfjxf,
  a.kwxf,
  a.tsbxxf,
  a.tsxxxf,
  a.dlbxxf,
  a.flxxxf,
  a.knsyxf,
  a.dexwxf,
  a.bybz,
  a.xwsybz,
  a.gxkxf,
  a.xxysyzdxf,
  a.whkcxf,
  a.kjwhkcxf,
  a.yskcxf,
  a.xxfyq,
  a.xynx,
  a.fxnx,
  a.bz,
  a.zt,
  a.gxkcxf,
  a.kcly2,
  a.kcly3,
  a.kcly4,
  a.kcly5,
  a.kcly6,
  a.kcly7,
  a.kcly8,
  a.kcly9,
  a.kcly10,
  a.kcly1
) select 
'2014' || substr(b.jxjhh,5,4),                                                    字符串的连接与截取
  b.ssxqdm,
  '2014',
  b.zydm,
  b.xklbdm,
  b.rs,
  b.bjs,
  b.zskcs,
  b.zdbyxf,
  b.ggbxxf,
  b.ggxxxf,
  b.xkbxxf,
  b.xkxxxf,
  b.zybxxf,
  b.zyxxxf1,
  b.zyxxxf2,
  b.sjkxf,
  b.fssjxf,
  b.jqsjxf,
  b.yyfjxf,
  b.kwxf,
  b.tsbxxf,
  b.tsxxxf,
  b.dlbxxf,
  b.flxxxf,
  b.knsyxf,
  b.dexwxf,
  b.bybz,
  b.xwsybz,
  b.gxkxf,
  b.xxysyzdxf,
  b.whkcxf,
  b.kjwhkcxf,
  b.yskcxf,
  b.xxfyq,
  b.xynx,
  b.fxnx,
  b.bz,
  b.zt,
  b.gxkcxf,
  b.kcly2,
  b.kcly3,
  b.kcly4,
  b.kcly5,
  b.kcly6,
  b.kcly7,
  b.kcly8,
  b.kcly9,
  b.kcly10,
  b.kcly1 
from jwxt.jy_zyxx b where b.zt=1 and b.jxjhh like '2013%' and b.jxjhh not in (
'20132188',                                                                              去掉约束冲突的记录
'2013218I',
'20134011',
'2013407J'
)

select * from jwxt.jy_zyxx b where b.zt=1 and b.jxjhh like '2014%'                       检验一下结果



//////////////



insert into JWXT.JY_PYJHYQ t ( 
t.jxjhh,t.pyjhzwmc,t.zt
)
select 
zyxx.jxjhh,zy.zymc||'2014级培养计划',1
 from jwxt.jy_zyxx zyxx 
 left join jwxt.sys_zy zy on zy.zydm = zyxx.zydm 
 where zyxx.jxjhh like '2014%' and zyxx.jxjhh not in (
 '20142188',
'2014218I',
'20144011',
'2014407J'
 )


展开阅读全文

没有更多推荐了,返回首页