20. orcle中统计一个字符串中某个字符的长度
2014-12-29 15:45
337 查看
例子1:统计一个字符串中“,”的个数:
select lengthb(regexp_replace('[a,b,c,d,e,f]','[^,]',null)) as res from dual;
例子2:查询lborganization表中字段fdncode包含1个"."号的所有记录:
select * from lborganization a where lengthb(regexp_replace('['||a.fdncode||']','[^.]',null)) =1;
例子3:把lborganization表中字段fdncode包含4个"."号的所有记录中的grade改为4:
update lborganization a set a.grade = 4 where lengthb(regexp_replace('['||a.fdncode||']','[^.]',null)) =4;
select lengthb(regexp_replace('[a,b,c,d,e,f]','[^,]',null)) as res from dual;
例子2:查询lborganization表中字段fdncode包含1个"."号的所有记录:
select * from lborganization a where lengthb(regexp_replace('['||a.fdncode||']','[^.]',null)) =1;
例子3:把lborganization表中字段fdncode包含4个"."号的所有记录中的grade改为4:
update lborganization a set a.grade = 4 where lengthb(regexp_replace('['||a.fdncode||']','[^.]',null)) =4;
相关文章推荐
- JS编写一个函数,实现传入一个不定长度字符串,查找出重复次数前n名的字符并分别统计其次数
- 统计任意长度字符串中各个字符及个数——计数排序的又一个应用
- 一个笔试面试经常问的问题——统计字符串中出现最多的字符及次数
- 4.4将一个字符串中的n个字符复制到另一个字符串中,如果n大于这个字符串的长度,则超出部分以NUL补充
- 将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符
- (Map实现)有一个字符串,其中包含中文字符、英文字符和数字字符,请统计和打印出各个字符的个数
- 统计一个字符串中出现的字符及其次数
- 怎样在创建TreeView时为每一个节点的data属性赋予一个长字符串值(长度不确定,几十个字符或者上万个字符),在单击节点的时候再将每个节
- 一个长度为10000的字符串,通过随机从a-z中抽取10000个字符组成.请用c#语言编写主要程序来实现
- 今天用Map集合写了一个字符串字符统计的程序,看集合看的头痛,就看了一下GUI,于是就随便记点。
- 一个字符串中包含另一个字符串所有字符的最短子串长度?——《编程之美》最短摘要的生成的简化
- 编写一个程序,输入一串不超过60个字符组成的且不包含换行符的字符串,将字符串中的A到Z的字母按英文字典字母顺序重新排列,排列后的单词的长度要与原始句子中的长度相同,并且要求只对A到Z的字母重新排列,其
- [每周一算法]统计在一个字符串中各个不同字符出现的次数
- 将字符串按照指定的长度进行分割(一个中文视为两个字符)
- 读入一个字符串(长度不大于100,不包括换行符’\n’),删去字符串中相同的排在后面的字符并输出。
- 写了一个字符串截取一定长度的代码,中文两个字符,英文一个字符,如果截断了自动用一个.或两个.来对齐,用于标题的显示
- java中如何计算一个字符串的byte长度(一个汉字多少字符)
- 递归问题之一:给定一字符串,输出字符串中所有字符子串的各种组合形式,长度为一个字符到字符串的长度,忽略排序
- php取含有中文的字符串的真实长度(一个中文算两个字符)
- 字符串统计,一个中文算2个字符,一个英文算一个字符