In oracle, the values of two tables are inserted to each other and the values of the table itself are inserted.

Source: Internet
Author: User


In oracle, the two tables insert values to each other and the table's own insert values have two tables, student and otherStudent, the table information is as follows: SQL> desc studentName Type Nullable Default Comments ---- ------------ ------- -------- NUM NUMBER www.2cto.com NAME VARCHAR2 (20) age number y SQL> desc otherStudentName Type Nullable Default Comments ---- ------------ ------- -------- NUM VARCHAR2 (50) NAME VARCHAR2 (50) Now do the following experiments. Once student has data, I want to insert the data in otherStudent. Insert into otherStudent (num, name) select num, name from student the type or length of the inserted fields in the two tables can still be inserted if they are consistent with each other, indicating that the inserted Table can receive the data, inconsistent type or length does not affect. Www.2cto.com Experiment 2 otherStudent has data. you can insert data from this table into this table and insert into otherStudent select * from otherStudent experiment 3 Statement insert into otherStudent select * from student. The error "too many values" is reported ". Statement insert into student select * from student otherStudent. The error "not enough value" is reported ".

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.