ORACLE中translate如何妙用?
ORACLE中translate如何妙用?
Oracle中关于PCTFREE和PCTUSED的说明 oracle更改用户密码过期,取消密码验证 Oracle多表创建的视图insert的解决方法 下面是文档中的话 The following statement translates a license number。
All letters 'ABC。。。Z' are translated to 'X' and all digits '012 。 。 。 9' are translated to '9': SELECT TRANSLATE('2KRW229', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '9999999999XXXXXXXXXXXXXXXXXXXXXXXXXX') "License" FROM DUAL; License -------- 9XXX999 The following statement returns a license number with the characters removed and the digits remaining: SELECT TRANSLATE('2KRW229', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789') "Translate example" FROM DUAL; Translate example ----------------- 2229 我们在利用TRANSLATE取出一个字段中的数字或文字的时候就可以巧用这个函数 select translate('23456中国3-00=。
,45','0123456789'||'23456中国3-00=。,45','0123456789') from dual; 如果要取出汉字的话转变一下就可以了 select trim(translate('23456中国3-00=。,45', '0123456789-=。
,', ' ')) from dual;。
答:按住空格键就可以了的详情>>