Mysql replication record implementation code _ MySQL
Source: Internet
Author: User
Mysql replication record implementation code bitsCN. comsql
Insert into 'Table' ('id', 'AA', 'BB ', 'CC') SELECT 'id', 'A', 'BB ', 'CC' FROM 'Table' (WHERE .....)
Tips:
/**
* When copying a new record, you may need to update the id or part of the data (assuming that the id is automatically increased)
*
* Text_aa is a fixed value. you can assign a variable value in a script call, for example, $ aa)
* Note the difference between 'text _ AA' and 'CC'. one is data and the other is field.
**/
Insert into 'Table' ('id', 'AA', 'BB ', 'CC') Select', 'AA content', 'BB pay attention to cc symbol difference ', 'CC' FROM 'Table' (WHERE .....)
/**
* CONCAT ('BB', 'additional information-copy ')
* Add additional information on the basis of extracting the original data (which is understandable when I have seen xxx. xxx in windwos)
**/
Insert into 'Table' ('id', 'A', 'BB ', 'CC') Select', 'AA content', CONCAT ('BB ', 'additional information-copy'), 'CC' FROM 'Table' (WHERE .....)
BitsCN.com
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