【发布时间】:2016-02-21 18:45:58
【问题描述】:
您可能知道,LISTAGG 允许您将多行中的值连接成一个值。
我正在尝试从多行构建正则表达式,然后将其提取以用于其他应用程序以搜索文件。
但是,there is a limit on the maximum length of regular expressions in Oracle (512 bytes)。
因此,我需要使用单独的 listagg 获取多行,然后导出该输出。
--The output I need is multiple rows with a listagg on 50 rows each
select '^.*(' || listagg(id, '|') within group (order by id) || ')' regex
from mytable
--where rownum < 50
这就是我卡住的地方。有可能吗?
【问题讨论】:
-
解决了!从 mytable 中选择不同的 '^.*(' || listagg(id, '|') 组内(按 id 排序)而不是(按楼层分区(rownum / 50))|| ')' 正则表达式
-
完成,但由于一些错误,我无法重新发布 sn-p。和评论里的一样。