oracle 同时添加和更新多条数据

 同时插入多条数据

  //从一个表查询数据插入到新表
  insert  into table(col1,col2) select  col1,col2 from table2;
  //往表里直接插入数据
  insert  into table (id,name) select  1,‘小明’ from dual  
  union all
  select 2,‘晓红’ from dual 。。。。。

同时更新多条数据
update  table1 set(col1,col2)=(select col1,col2 from table2)where ?=?;




你可能感兴趣的:(数据库)