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
相關文章
相關標籤/搜索