oracle查看字符串中某个字符出现次数

记录备忘

查看字符串',01234,2342,2,'中逗号出现次数

SQL> select translate(',01234,2342,2,', 'a0123456789', ' ') from dual;
 
TRANSLATE(',01234,2342,2,','A0
------------------------------
,,,,

SQL> select length(translate(',01234,2342,2,', 'a0123456789', ' ')) from dual;
 
LENGTH(TRANSLATE(',01234,2342,
------------------------------
                             4


判断字符串是否是数字

trim(translate(value, '0123456789', ' ')) is null


 

你可能感兴趣的:(例子,备忘,数据库)