确定字符串第二个大写字母的位置并分拆
来源:互联网 发布:国外网络支付平台 编辑:程序博客网 时间:2024/05/17 04:42
Zygophyllum macropodum Boriss.
Zygophyllum
Zygophyllum macropodum
Zygophyllum potaninii Maxim.
Zygophyllum oxycarpum Popov
Zygophyllum loczyi Kanitz
Zygophyllum pterocarpum Bunge
Zygophyllum sinkiangense Y. X. Liou
上述字段,我想找到各个字符串中第二个大写字母的位置并分拆成两列,如果仅有一个大写的则不分拆,以上分拆结果为:
Zygophyllum macropodum Boriss.
Zygophyllum
Zygophyllum macropodum
Zygophyllum potaninii Maxim.
Zygophyllum oxycarpum Popov
Zygophyllum loczyi Kanitz
Zygophyllum pterocarpum Bunge
Zygophyllum sinkiangense Y. X. Liou
with cte(name) as(
select 'Zygophyllum macropodum Boriss.' union all
select 'Zygophyllum' union all
select 'Zygophyllum macropodum' union all
select 'Zygophyllum potaninii Maxim.' union all
select 'Zygophyllum oxycarpum Popov' union all
select 'Zygophyllum loczyi Kanitz' union all
select 'Zygophyllum pterocarpum Bunge' union all
select 'Zygophyllum sinkiangense Y. X. Liou'
),
tb as(
select c.*,number,ROW_NUMBER()over(partition by c.name order by number) as rownum
from cte c,master..spt_values s
where s.type='P'
and s.number between 1 and len(c.name)
and substring(c.name,number,1) COLLATE Chinese_PRC_CS_AS like '%[ABCDEFGHIJKLMNOPQRSTUVWXYZ]%'
)
select name,name vl1,null vl2
from tb t1
where t1.rownum=1
and not exists(select 1 from tb t2 where t1.name=t2.name and t2.rownum>1)
union all
select name,SUBSTRING(name,1,number-1),SUBSTRING(name,number,len(name)-number+1)
from tb
where rownum=2
- 确定字符串第二个大写字母的位置并分拆
- 在一个字符串(1<=字符串长度<=10000,全部由大写字母组成)中找到第一个只出现一次的字符,并返回它的位置
- 26.在一个字符串(1<=字符串长度<=10000,全部由大写字母组成)中找到第一个只出现一次的字符,并返回它的位置
- 获取中文字符串的第一个大写字母
- 两个字符串,第二个字符串是第一个的子串,打印第二个字符串缺了的字符位置
- 倒叙打印文件第二行的前100个大写字母
- 字符串转换,将其中的大写字母变小写字母,小写字母变大写字母,并输出 。
- C#将获取中文字符串的首个大写字母
- 确定一个字符串在规定的字符串中的行列位置
- 汇编语言程序设计:编写程序完成将第二个字符串插到第一个字符串的指定位置上
- 《c程序设计语言》读书笔记-第二个字符串任意一个在第一个字符串出现的位置,未出先返回-1
- strlen讲解和快速确定字符串结束符的位置
- 产生10个长度为10的不能重复的字符串(里面只能出现大写字母、小写字母、0-9的数字),并遍历打印输出
- javascript 找到第二个参数的位置
- 输出大写字母字符串中每个大写字母之后的第5个字母所对应的小写字母
- C语言:从键盘输入两个字符串,输出第一个字符串在第二个字符串中的位置
- 把一个字符串的大写字母放到字符串的后面,各个字符的相对位置不变,不能申请额外的空间
- 把一个字符串的大写字母放到字符串的后面,各个字符的相对位置不变,不能申请额外的空间
- POJ1716 Integer Intervals(区间选点)
- [sicily]1000. 函数求值
- Myeclipse如何自动创建hibernate以及配置struts2以及数据库表创建映射文件 详解
- Module build failed: TypeError: this._init is not a function
- 最简单的基于FFMPEG的封装格式转换器(无编解码)
- 确定字符串第二个大写字母的位置并分拆
- Maven构建Spring Boot+Mybatis+derby的配置
- NotePad++访问linux文件
- 解除ServiceStack.Text免费配额限制
- CryEngine Plugin 创建
- 手把手教你制作一张哆啦A梦的壁纸
- 我的爸爸刘狗蛋
- 【C++学习笔记】模板于内联函数使用注意
- 数据结构与算法分析 c++11 红黑树 (Red black tree)