Oracle queries the data of one table and inserts it into another table.

Source: Internet
Author: User

Oracle queries the data of one table and inserts it into another table.

1. Add a new table through the structure and data of another table

Create table XTHAME. tab1 as select * from DSKNOW. COMBDVERSION

2. If the table exists:

Insert into tab1 select * from tab2;

 

3. In the same table, assign field A to field B:

Update table_name set B =;

 

4. Insert the field data of one table into the field data of another table

Insert into XTHAME. tab1 (pk_bdversion, vbdcode) select pk_bdversion, vbdcode from DSKNOW. COMBDVERSION;

* If a warning is reported: ORA-00928: Missing SELECT keyword Error

The reason is: tab1 (Field1, Field2,...) cannot be enclosed in single quotes.

5. Extend the 4th point. Insert multiple fields in the same table into multiple fields in multiple tables.

Insert into xthame. BUTTON (button_id, button_name, button_code) select. pk_examquest, B. pk_bdversion,. vquestname from dsknow. COMBDVERSION B, DSKNOW. RQT_EXAMQUEST a where. pk_examquest = '1001sx000000000jobv 'and B. pk_bdversion = '1000bdv1_10101001 ';

Obtain 【]Java background framework springmvc integrates the mybatis framework source code bootstrap html5 mysql oracle

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.