ITPub博客

首页 > 数据库 > Oracle > sql对表数据进行复制

sql对表数据进行复制

原创 Oracle 作者:lcq_0618 时间:2014-07-03 20:16:55 0 删除 编辑
1、不同表之间的数据复制(两个表已经存在)
    insert into table1(field1, field2, filed3) select col1, col2, col3 from table2 where oid = ‘XX’;
    要求两个表必须存在。
2、同一表复制
    insert into table1 select oid col1, col2, col3 from table1 where oid = ‘XX’;
3、不同表之间复制数据,并根据复制的数据创建新表
    select col1, col2 into table2 from table1
    此时table1存在,table2不存在,根据table1中的列定义创建table2.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10712951/viewspace-1208816/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-01-09

  • 博文量
    9
  • 访问量
    57805