Oracle inserts the queried data into a table in the database

Source: Internet
Author: User

一、Oracle数据库中,把一张表的查询结果直接生成并导入一张新表中。   例如:现有只有A表,查询A表,并且把结果导入B表中。使用如下SQL语句:   create table b as select * from a   二、Oracle数据库中支持把查询结果导入到另外一张表中。   例如:有两个表A和B   1)如果两个表的表结构是否相同,但要插入的字段类型相同:   (1)把A表的全部字段数据插入到B表中: insert into B select * from A;   (2) put a data for some fields in table Insert b table: insert into B(字段名)(select 字段名 from A)   2)果不在同一个schema下请在表名前加上schema,例如有schema a和b:   insert into b.B select * from a.A

Oracle inserts the queried data into a table in the database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.