字符串类
CHARSET(str) //返回字串字符集
___________________________________________
字符串连接
select concat('abc','def','hig');
——————————————————————————————————————
INSTR (string ,substring ) //返回substring首次在string中出现的位置,不存在返回0
_____________________________________________________________________
//转换成小写
select LCASE ('ABCdef');
————————————————————————————————————————
LEFT (string2 ,length ) //从string2中的左边起取length个字符
select LEFT ('ABCdef',3);
——————————————————————————
LENGTH (string ) //string长度
select LENGTH('ABCdef');
——————————————————————————————
LOCATE (substring , string [,start_position ] ) 同INSTR,但可指定开始位置
——————————————————————————————————————
LPAD (string2 ,length ,pad ) //重复用pad加在string开头,直到字串长度为length
select LPAD ('test' ,8 ,'a' );
————————————————————————
LTRIM (string2 ) //去除前端空格
————————————————————————
REPEAT (string2 ,count ) //重复count次
——————————————————————————————————
REPLACE (str ,search_str ,replace_str ) //在str中用replace_str替换search_str
————————————————————————————————————
RPAD (string2 ,length ,pad) //在str后用pad补充,直到长度为length
________________________________________________________________________________________
RTRIM (string2 ) //去除后端空格
————————————————————————————
#STRING compare的意思 字符串比较
逐字符比较两字串大小
select STRCMP ('test' ,'kk');
_____________________________________________________________________
SUBSTRING (str , position [,length ]) //从str的position开始,取length个字符, 注:mysql中处理字符串时,默认第一个字符下标为1,即参数position必须大于等于1
_____________________________________________________________________________
____________________________________________________________________________________________
SELECT
UCASE('tssertttssdft')
___________________________________________
SELECT
right('tssertttssdft' , 3)
__________________________
SPACE(count) //生成count个空格
SELECT
SPACE(3)
————————————————————————————————————————