(1)concat() 拼接字符串
例如:查询雇员的信息,以指定格式输出
select concat("职员入职时期",hiredate,"职员工资",sal) from emp
雇员姓名:XX,薪资:XX,职位:XX,入职日期:XX,年薪:XX
(2)length()计算字符串的长度
select * from emp where length(ename=5);
例如:查询雇员中雇员姓名长度是5的雇员信息
(3)lower() upper()转换大小写 将字符串name 转化成大写和小写的格式
select lower(ename),upper(ename) from emp ;
例如:查询雇员姓名,大写的雇员姓名 ,小写的雇员姓名
(4)replace()在指定的字符串中,将某子串替换为新的字符串
select replace("hlewwo","hle","wowo")
replace(目标字符串,查找的子串,新字符串)
例如:将helloword字符串中的hello替换为hi
(5)substring()截取子串
substring(目标字符串,开始位置,长度)
select substring(ename,1,3) from emp;
注意:开始索引是从1开始,不是0