! Refer Image description ((img.ask.csdn.netupload201504071428383413_989153.jpg) Table B has three fields: aid, partname, and partid. I want the partid field to add regular strings based on the value of partname. For example, if the partname field is PART1, the partid field is added with a value of 1 P. if the partname field is PART2, the partid field is added with a value of 2 P. in addition to the preceding format, the partname values include TV01, TV02, special... string mysql
Table B has three fields: aid, partname, and partid. I want the partid field to add regular strings based on the value of the partname field.
For example, if the partname field value is PART 1, add 1 P to the partid field, and if the partname field value is PART 2, add 2 P to the partid field,
In addition to the preceding formats, the partname values include TV 01 and TV 02. the features are strings with (none) spaces and numbers,
There is also a number that is clipped in the middle of the string, 1st words, 2nd words, 11th words. The last simplest is a pure number, 1, 2, 3
The statement extracts the numbers in the three feature fields, and adds 1 P, 2 P, and 2 P to the partid field,
The value of 3 p.
How can I write SQL statements like this?