1. String Case Conversion:
(1). Replace all lowercase letters in the user_name field of the Tbl_student table with uppercase:
Update tbl_student set User_name=upper (user_name);
(2). Replace all uppercase letters in the User_name field of the Tbl_student table with lowercase:
Update tbl_student set User_name=lower (user_name);
2. Clear the string leading or trailing spaces, or specify the characters:
(1). Clear the User_name field of the Tbl_student table the leading and trailing spaces
Update tbl_student Set User_name=trim ("from user_name);
(2). Clear the string header with the specified character a:
Update Tbl_student Set User_name=trim (Leading ' A ' from user_name);
(3). Clear string trailing specified character b
Update tbl_student set User_name=trim (TRAILING ' B ' from user_name);
3. Replace the string:
(1). The number 1 in the replacement string is the letter I
Update tbl_student Set User_name=replace (user_name, ' 1 ', ' I ');
4. Using the Regular (REGEXP):
(1). If the ending two is a letter, remove
Update tbl_student Stu Stu.user_name=substring (Stu.user_name,length (Stu.user_name)-2) where Stu.user_name REGEXP ' [ A-za-z]{2,}$ ';
Several common uses of MySQL string processing functions