oracle - Oracle REGEXP_SUBSTR 在有多个空格时按空格提取字符串
问题描述
您好我是 Oracle SQL 的新手,我想LiIon Polymer
从6Cell LiIon Polymer
.
我使用REGEXP_SUBSTR('6Cell LiIon Polymer', '\S+', 7)
但它只返回LiIon
解决方案
您想要第一个空格后面的子字符串吗?使用好的,旧的 substr
+instr
组合。首先是样本数据,您可能感兴趣的查询从第 4 行开始。
SQL> with test (col) as
2 (select '6Cell LiIon Polymer' from dual)
3 --
4 select substr(col, instr(col, ' ') + 1) result
5 from test;
RESULT
-------------
LiIon Polymer
SQL>
推荐阅读
- java - Spring Cloud 2.1.3.RELEASE 兼容版本 Ribbon 负载均衡器
- javascript - 结合 await 和 Promise.all 在我的 node.js 微服务中不起作用
- angular-dynamic-components - 动态组件未加载到专利组件内
- java - Android:调整软键盘不起作用
- node.js - 文本文件中的节点js输入值
- hyperledger-fabric - 使用版本 1.4 的 Hyperledger Fabric 客户端 SDK 时出错
- scala - 如何根据数据类型在 Spark Dataframe 中动态更改列数据类型
- javascript - 如何将 PDF 嵌入 Firefox 的 html 页面的一部分
- vue.js - Vuetify 与 3rd 方表单组件 - 如何像 v-text-field 一样设置样式
- ruby-on-rails - 无法通过 Bundler 安装 gem。偏僻的: !偏僻的: !Push 被拒绝,无法编译 Ruby 应用程序。远程:远程:!推送失败