1. 新增一个表,通过另一个表的结构和数据
create table XTHAME.tab1 as select * from DSKNOW.COMBDVERSION
2. 如果表存在:
insert into tab1 select * from tab2;
3.同一个表中,将A字段的指赋给B字段:
update table_name set B =  A;
4. 将一个表的字段数据插入到另一个表的字段数据中
insert into 表1(字段1,字段2,字段3,...)  select 字段1,字段2,字段3,... from  表2;
* 如果报提醒:ORA-00928: 缺失 SELECT 关键字错误
原因是:这里tab1(Field1,Field2,....)不能加单引号
5. 第4点的延伸,多个表的多个字段,插入同一个表的多个字段。
 INSERT INTO XTHAME.BUTTON (button_id, button_name, button_code) 
 select a.pk_examquest, b.pk_bdversion,a.vquestname  FROM  DSKNOW.COMBDVERSION b ,DSKNOW.RQT_EXAMQUEST a  where a.pk_examquest='1001SX1000000000JOBV' and b.pk_bdversion='1000BDV1000010101001';

摘自,并修改

https://www.cnblogs.com/summary-2017/p/9064197.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
相关资源
相似解决方案