首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

replace跟translate

2012-07-02 
replace和translatereplace(123123tech, 123)would return techtranslate(1tech23, 123, 456

replace和translate

replace('123123tech', '123');would return 'tech'translate('1tech23', '123', '456');would return '4tech56'translate('222tech', '2ec', '3it');would return '333tith'

:: extact one to on e matching of character like 'a' or '1'
?? replace character is needed
select translate('abc132fdsf','0123456789',' ') from dual;

?

?

-------

abcfdsf

或按以下方式

SQL> select translate('abc132fdsf','#0123456789','#') from dual;

?

-------

abcfdsf

--提取字符串中的数字,字母都被过滤,如下:

?

SQL> select translate('abc132fdsf','abcdefghigklmnopqrstuvwxyz',' ') from dual;

?

?

----

132

热点排行