我試圖從使用Oracle SQL的REGEXP_SUBSTR與clob中提取多個字符串。SQL Clob搜索Clob中的多個字符串並加入,可能REGEXP_SUBSTR
clob_field例如:
xxx xxx"xxxxxxxYY=1234xxxxx.xxxx.xxxx"xx xxxxxxxxxxxxxx
xxxxx"xxxxxxxYY=2345xxxxx.xxxxx.xxxxxxxxxxxx"xxxx xxxxxxxxxx
xxx xxxxx"xxxxxxxxxxxxxxYY=34567xxxxx.xxx.xxxxx"xxxxxxxxxxxx
xxxx"xxxxxYY=4567xx.xxxxxx"xxxxxxxxxx xxxxxxxxxxx xxxxxxxx
我已經試過:
select a.id, regexp_substr(b.clob_field,'YY=',",[^"]+"') "clob_result"
from table1 a, table2 b
where a.id = b.id
從連接查詢例如期望的結果是:
id clob_result
1 xxxxxxxYY=1234xxxxx.xxxx.xxxx
1 xxxxxxxYY=2345xxxxx.xxxxx.xxxxxxxxxxxx
1 xxxxxxxxxxxxxxYY=34567xxxxx.xxx.xxxxx
1 xxxxxYY=4567xx.xxxxxx
不清楚如何搜索包含「STRING YY =',然後返回整個字符串「開頭和結尾」
任何幫助,非常感謝!
謝謝你的評論Peach,又是Egor。 – Temu