What should I do if I need MySQL to update the field to re-section data instead of all the data? Here are a few ways to update some of the data in the MySQL field in two scenarios for your reference.
MySQL updates some of the data in the field in the first case:
Update tab SET A = concat (substring (a,1,3), ' BBB ');
Starting from a 1 characters to take 3 characters, plus ' BBB ', and then write a, if the original value of a is ' 123aaa ', then the update is ' 123BBB '.
MySQL updates some of the data in the field in the second case:
1.Mysql Fuzzy query:
SELECT * FROM table where num like '%a% ';
The query has a string of 2. MySQL updates some data for field values:
We may encounter a request to modify the value of one of the fields in the database to another, so you might think of update immediately. For example:
Replace all of the values in field a with 1 with 2.
The SQL statement is written like this: Update table set a=2 where a=1;
So what if we're going to talk about the 1 in the field a value, and replace it with 2?
For example: a=2211, now to replace 2222, is to change 1 to 2
The SQL statement reads: Update table Set A=replace (A, ' 1 ', ' 2 ');
MySQL updates some of the contents of a string field