TRIM()函数
去掉最后一个字符
select TRIM('市' from region_desc) from dual;
instr()函数
判断字符串是否包含另一个字符串
instr(region_desc,'市') > 0
不包含是等于0
包含是大于0
- 去掉首尾空格
SELECT TRIM(' abc '), ltrim(' abc '), rtrim(' abc ') FROM dual;
- 去掉首尾多个字符
SELECT LTRIM('thetomsbthhe', 'the'),
RTRIM('thetomsbthhe', 'the')
FROM dual;