oracle trim函数

本文参考http://blog.csdn.net/indexman/article/details/7748766sql


语法描述以下:.net

TRIM([ { { LEADING | TRAILING | BOTH }
         [ trim_character ]
       | trim_character
       }       FROM 
     ]
     trim_source
    )

    参数解释:code

    leading   开头字符blog

    trailing    结尾字符class

    both        开头和结尾字符select

    trim_character  去除的字符语法

    trim_source      修剪源im

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
相关文章
相关标签/搜索