1.字符串大小写转化:
(1).将tbl_student表的user_name字段所有小写字母,替换为大写:
update tbl_student set user_name=UPPER(user_name);
(2).将tbl_student表的user_name字段所有大写字母,替换成小写:
update tbl_student set user_name=LOWER(user_name);
(1).清除tbl_student表的user_name字段首尾空格
update tbl_student set user_name=TRIM(' ' from user_name);
(2).清除字符串首部指定字符A:
update tbl_student set user_name=TRIM(LEADING 'A' from user_name);
(3).清除字符串尾部指定字符B
update tbl_student set user_name=trim(TRAILING 'B' from user_name);
(1).替换字符串中的数字1为字母I
update tbl_student set user_name=replace(user_name,'1','I');
(1).若结尾两个为字母,则去掉
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,}$';