当前位置:网站首页>oracle列转行,拆分一个字段为多列
oracle列转行,拆分一个字段为多列
2022-04-21 20:45:00 【人生在勤,不索何获-白大侠】
select regexp_substr(cgi,'[^/]+',1,level,'i') as CGI,'4G' as ne_mode,t1.PROPERTY_NUM,city,county,PROPERTY_NAME
from nwom.T_SITE_IMPORT_SENCE_HOOM t1
where cgi is not null
connect by t1.PROPERTY_NUM = prior t1.PROPERTY_NUM
and prior dbms_random.value is not null
and level<= regexp_count(cgi,'[^/]+')
1、regexp_substr用法如下:
function REGEXP_SUBSTR(srcstr, pattern, position, occurrence, modifier)
__srcstr : 需要进行正则处理的字符串
__pattern :进行匹配的正则表达式
__position :起始位置,从第几个字符开始正则表达式匹配(默认为1)
__occurrence :标识第几个匹配组,默认为1,当要匹配全部时,指定该位置的内容为level
__modifier :模式('i’不区分大小写进行检索;‘c’区分大小写进行检索。默认为’c’。)
例1:SELECT REGEXP_SUBSTR('17,20,23','[^,]+',1,1,'i') AS STR FROM DUAL;
例2:SELECT REGEXP_SUBSTR('17,20,23','[^,]+',1,3,'i') AS STR FROM DUAL
例3:
SELECT REGEXP_SUBSTR('17,20,23', '[^,]+', 1, LEVEL, 'i') AS STR
FROM DUAL
CONNECT BY LEVEL <=
LENGTH('17,20,23') - LENGTH(REGEXP_REPLACE('17,20,23', ',', ''))+1;
例4:
SELECT REGEXP_SUBSTR('17,20,23', '[^,]+', 1, LEVEL, 'i') AS STR
FROM DUAL
CONNECT BY LEVEL <=
regexp_count('17,20,23','[^,]+')
LENGTH(‘17,20,23’) - LENGTH(REGEXP_REPLACE(‘17,20,23’, ‘,’, ‘’))+1
相当于regexp_count(‘17,20,23’,’[^,]+’)
版权声明
本文为[人生在勤,不索何获-白大侠]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_38390307/article/details/124200569
边栏推荐
- Circular linked list of single and double linked lists (XV)
- Go语言自学系列 | golang类型定义和类型别名
- 6、Qt使用MySQL例子
- Liu Zhigang, former COO of Jinshan cloud, joined Baihai technology as president
- Rhcsa (day 5)
- 135、137、138、139和445端口解释及关闭方法
- Traceup | use project management software to help overcome procrastination
- Channel allocation don't use the four-color theorem
- How to use xUnit framework to maintain test cases?
- Debugging MS source code
猜你喜欢

< 2021SC@SDUSC > Introduction to the jpress group on software engineering application and practice of Shandong University

<2021SC@SDUSC>山东大学软件工程应用与实践JPress代码分析(一)

单、双链表的循环链表(十五)

< 2021SC@SDUSC > Application and practice of software engineering in Shandong University jpress code analysis (2)

135、137、138、139和445端口解释及关闭方法

Actual combat | performance pressure test of JMeter typical e-commerce scenario (order / payment)

终于有人讲明白了,原来这才是全球低时延一张网技术

实战 | 基于JMeter 完成典型电商场景(首页浏览)的性能压测

实战 | 电商业务性能测试(二): Jmeter 参数化功能实现注册登录的数据驱动

他98年的,我玩不过他...
随机推荐
PR视频添加字幕
[high concurrency] analysis of thread pool and ThreadPoolExecutor class
Mysql坑爹指南_sql_mode=“ONLY_FULL_GROUP_BY“所导致错误以及不能使用group by
单、双链表的循环链表(十五)
TGIP-CN 038 报名|深度解析 Apache Pulsar 源码阅读正确姿势(一)
5、Qt使用MySQL
如何用Sonic云真机打王者
博客推荐|详解 Apache Pulsar 2.10 新特性——自动化集群故障转移
Why do you have no idea when doing data analysis?
Andorid --- 为什么要使用事务,什么叫做事务的提交和回滚?
Unity3d C#利用材质(Material)贴图的偏移实现2D游戏单背景图无限移动背景效果功能(含源码)
gstreamer学习
在两个TIA博途项目中组态PROFIBUS和PROFINET通信的具体方法
avformat_new_stream理解
Go语言自学系列 | golang init函数
After three years of graduation, he achieved nothing and was forced to go back to his hometown. He made a decision to change his life.
复线性空间与复结构
C语言题目一:1,2,3,4能组成的三位数
oracle数据导入记录笔记
1、MySQL Workbench 8.0安装