oracle 如何截取两个"-"之间的字符串?

2024-12-13 20:45:07
推荐回答(1个)
回答1:

SELECT REGEXP_SUBSTR('奥迪虚升-A5-Coupe Qu-2.0T-7档自动-两门四驱-西拦昌拉红-深内饰', '[^-]+', 1, LEVEL, 'i') AS STR
FROM DUAL
CONNECT BY LEVEL <=
LENGTH('奥迪-A5-Coupe Qu-2.0T-7档自动-两门四驱-西拉红-深内饰差衡老') - LENGTH(REGEXP_REPLACE('奥迪-A5-Coupe Qu-2.0T-7档自动-两门四驱-西拉红-深内饰', '-', ''))+1;