1. 字符串相关函数
select charset(name) from student;
select concat(ename,' job is ',job) from student;
select instr ('12333121','12') from dual;
select ucase(name) from student;
select lcase(name) from student;
select left(name, 2) from student;
select right(name, 2) from student;
select length(name) from student;
select replace(name,'jsr1','小金') from student;
select strcmp('jsr1', 'jsr2') from dual;
select substring(name, 1, 2) from student;
select ltrim(' jjjj') from dual;
select rtrim('jjjj ') from dual;
select trim(' jjjj ') from dual;
以首字母小写的方式显示所有员工 emp 表的姓名
法一:
先取出ename的第一个字符,转成小写
然后把他和后面的字符串进行拼接、
select concat(lcase(substring(ename,1,1), sunstring(ename,2))
from emp;
select concat(lcase(left(ename,1), sunstring(ename,2))
from emp;