本文参考http://blog.csdn.net/indexman/article/details/7748766
语法描述如下:
TRIM([ { { LEADING | TRAILING | BOTH } [ trim_character ] | trim_character } FROM ] trim_source )
参数解释:
leading 开头字符
trailing 结尾字符
both 开头和结尾字符
trim_character 去除的字符
trim_source 修剪源
select trim(leading ‘x‘ from ‘xhellox‘) from dual;--hellox select trim(trailing ‘x‘ from ‘xhellox‘) from dual;--xhello select trim(both ‘x‘ from ‘xhellox‘) from dual;--hello select trim(‘x‘ from ‘xhellox‘) from dual;--hello select trim(‘ xhellox ‘) from dual;--xhellox select trim(trailing from ‘xhellox ‘) from dual;--xhellox select trim(trailing ‘x‘ from null) from dual;--empty select trim(trailing null from ‘xhellox‘) from dual;--empty