0
点赞
收藏
分享

微信扫一扫

MYSQL 寒假自学 2022 十二 (四)

暮晨夜雪 2022-02-15 阅读 71


-- 9,返回字符串的后几个字符
select right('hello',3);  #llo

-- 10,字符串比较
select strcmp('hello','world'); #-1
select strcmp('aaa','aaa'); # 0
select strcmp('aaad','aba'); #-1
select strcmp('b','a'); #1

-- 11,字符串截取
select substr('hello',2,3); #ell
select substring('hello',2,3); #ell

-- 12,将小写转大写
select ucase('helloWorld');#HELLOWORLD
select upper('helloWorld');

-- 13,将大写转小写
select lcase('HELLOworld');#helloworld
select lower('HELLOworld');
举报

相关推荐

0 条评论