Replication of table's constructed data

Source: Internet
Author: User
When maintaining a database, a large amount of data entry is encountered, very time-consuming, once created data how to reuse, you must know how to replicate tables and data ✪ table construction + data replication ✪ table construction Replication ✪ data replication 1 table construction + data replication from the retrieved results to copy column construction and records, and creating a new table, simple and efficient CREATE TABLE table name SELECT * from the table to be replicated use this method for possible column property changes VARCHAR (20) may be modified to char (20) to confirm the construction of the table by using the DESC table name after the replication completes 2 replication Table construction This method replicates only the structure of the table to create a new table, but auto_increment PRIMARY KEY column constructs are copied the CREATE table name like the copy of table 3 data to be copied in fact, this is based on the 2nd step above, which is simply rude to the existing Table Insert data inser into table name SELECT * from the table you want to copy you can restrict the extracted records by adding restricted statements such as where or limit, and in this way copy data from tables with different table structures to insert into user (' name ') S Elect Goods_name from goods

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.