sql - 如何通过识别句子的字符[0-9A-Z,."#*]的最后位置来获取字符串
问题描述
限制:最大字符串长度为 268,435,456 个 Unicode 字符(256 个兆字符)或 536,870,912 个字节。这是尺寸限制。
这是情况:我需要最后一个字符的大小限制。甲骨文抛出错误,如
:不一致的数据类型:预期 - 得到 CLOB
如何修复此类错误,XMLAGG 是一种选择吗?
下面是测试代码:
` WITH q AS (
SELECT 'All aboard!
Hahahahaha
Aye Aye Aye Aye Aye Aye...
Crazy, but that s how it goes
Millions of people living as foes
Maybe it s not too late
To learn how to love and forget how to hate
Mental wounds not healing
Life s a bitter shame
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I ve listened to preachers, I ve listened to fools
I ve watched all the dropouts who make their own rules
One person conditioned to rule and control
The media sells it and you live the role
Mental wounds still screaming
Driving me insane
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I know that things are going wrong for me
You gotta listen to my words
Yeah
Heirs of a cold war, that s what we ve become
Inheriting troubles, I m mentally numb
Crazy, I just cannot bear
I m living with something that just isn t fair
Mental wounds stop healing
Who and what s to blame
I m going off the rails on a crazy train' AS sentence FROM DUAL)
SELECT SUBSTR(sentence,-256) AS Y FROM Q; `
结果:
是的,冷战的继承人,这就是我们已经成为的继承麻烦,我精神麻木疯了,我无法忍受我生活在不公平的事物中精神创伤停止愈合精神创伤停止愈合谁和什么该怪我要走了疯狂火车上的铁轨
测试场景:代码必须返回以下场景的值
'您好,我们有 14 个苹果在篮子里,我们使用#1243432 航班号通过澳大利亚将它们运送到日本,价格为 23142 美元'
' 塑料怎么能假装在受支持的新人之上?为什么恐怖不能超过慈善骑士?头盔想!任何病房如何误印发射器?更高的内核忽略了具有感知数组的集合。解剖学在背部缺陷周围笑了?
' 949490909232 你怎么了?
' 谢谢'
'1941 年 5 月 16 日'
' 1. 嗨,伙计
这不是最好的主意;
足球是世界流行的运动吗
白宫能容纳多少头大象
一头狮子在2年内可以吃掉6头鹿、4头斑马和8头水牛。
解决方案
我猜你需要这个——
SELECT SUBSTR(sentence,-LENGTH(sentence), 256) AS Y
FROM Q;
推荐阅读
- linux - 我想在运行命令时获得变量的输出,但它都被合并到一行中。我应该怎么办?
- sql - af:query 中的多选 LOV
- java - Selenium webdriver - 无法在模式对话框中找到元素
- node.js - 使用 async/await 的 mongodb 连接 - NodeJS
- python - 如何创建带有图片的博客文章类型的表单?不断出现错误:NameError:未定义名称'blog_post_id'
- php - 从 Laravel 中的 Mysql Pivot 表中获取列并返回 JSON 对象
- eclipse-cdt - 如何以编程方式设置 Eclipse CDT 配置构建目录?
- c# - 是否还有 Microsoft Authenticator 开发 API?我该如何使用它?
- php - 如何在 echo 部分插入 php 代码。WordPress
- react-native - 无法使用 AWS S3 使用 react native 上传或获取任何文件