MySQL replication record Implementation code _MYSQL

Source: Internet
Author: User
Sql
Copy Code code as follows:

INSERT into ' table ' (' id ', ' aa ', ' BB ', ' cc ') SELECT ' id ', ' aa ', ' BB ', ' cc ' from ' table ' (WHERE ...)

Tips:
Copy Code code as follows:

/**
* When you copy a new record, you may want to update the ID or part of the data (assuming ID is incremented)
*
* TEXT_AA is a fixed value, you can assign the value of a variable in a script call such as ($AA)
* Note the difference between ' Text_aa ' and ' cc ', one is the data, the other is the field
**/
INSERT into ' table ' (' id ', ' aa ', ' BB ', ' cc ') SELECT ', ' AA content ', ' bb note cc symbol difference ', ' cc ' from ' table ' (WHERE ...)

/**
* CONCAT (' BB ', ' Additional information-copy ')
* On the basis of the extraction of the original data, add additional information (see Windwos under the xxxx.xxx understand)
**/
INSERT into ' table ' (' id ', ' aa ', ' BB ', ' cc ') SELECT ', ' AA content ', CONCAT (' BB ', ' Additional information-copy '), ' cc ' from ' table ' (WHERE ...)

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.