常用的字符串函数有以下几种
1.字符串拼接,将指定的几个字符串拼接为一个字符串
函数名是concat(s1,s2,s3)
sql
select concat('hello','mysql');
执行结果

2.转为小写
函数名lower
sql
select lower('HELLO');
3.转为大写
函数名为upper
sql
select upper('hello');
4 左填充
函数名为lpad,lpad(str,n,pad),这些参数含义是str字符串左边要填充为长度为n的字符串,用pad填充
sql
select lpad('01',5,'-');
执行结果

5 右填充,语法和左填充一样,函数名为rpad()
sql
select rpad('01',5,'-');
执行结果为

6 substring 返回从字符串某个索引开始取指定长度的字符串
sql
select substring('hello world',1,5);
执行结果

7 去除字符串前后空格
函数名trim
sql
select trim(' hello world ');