去除两端空格:
select TRIM(' A A ');
查询结果:A A
去除两端指定字符串:
select TRIM('abc' from 'abcabc123123abc');
查询结果:123123
update tb_lemon_emp set name = RTRIM(name) ;
update tb_lemon_emp set name = LTRIM(name) ;
update tb_lemon_emp set name = TRIM(name) ;
update tb_lemon_emp set tel = TRIM('189' from tel) ;
2、LTRIM(str)/RTRIM(str):去除左边/右边空格
去除左边空格:
select LTRIM(' A A ');
查询结果:A A (后面还有空格)
去除右边空格:
select RTRIM(' A A ');
结果: A A
欢迎来到testingpai.com!
注册 关于