如果它能为
返回正确的值,请注意如何重写REGEXP_SUBSTR
函数
select REGEXP_SUBSTR('110001,|A1|1|||||N,A1,1,,,,,N,2T BBA HF LOW COST,HOME FINANCING-i',
'[^,]+',
1,
11)
from dual
预期结果:HOME FINANCING-i
答案 0 :(得分:0)
您需要调整模式以匹配两个逗号([^,]*)(,|$)
之间的空白:
with t1(col) as(
select '110001,|A1|1|||||N,A1,1,,,,,N,2T BBA HF LOW COST,HOME FINANCING-i'
from dual
)
select regexp_substr(col, '([^,]*)(,|$)', 1, 11, 'i', 1) as res
from t1
结果:
RES
----------------
HOME FINANCING-i