codecamp

向两张数据表中插入数据

  1. 在两张数据表中,如何快速将一张数据表中的数据快速插入插入另一张数据表
    两张表数据结构一致的情况:  
insert into table_1 select * from table_2;

    两张数据表结构不一致的情况: 

insert into table_1 (col_name1, col_name2) .... select col_name1, col_name2 form table_2

    2.在创建表的时候,将已经存在的数据表中的数据插入创建的表中。

create table table_name like table_exist select * from //如果不添加select * from table_exist(已经存在的数据表),此时仅仅将table_exist的结构复制给table_name 


实战篇
oracle
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定