SELECT REGEXP_SUBSTR('BSP/B2B/SFS', '[^/]+', 1, rownum) as item
FROM DUAL
CONNECT BY ROWNUM <= LENGTH('BSP/B2B/SFS') -
LENGTH(REPLACE('BSP/B2B/SFS', '/', '')) + 1)
,BPET,BSP,B2B, 包含 B2B/BSP
select *
from (SELECT REGEXP_SUBSTR('BSP/B2B/SFS/', '[^/]+', 1, rownum) as item
FROM DUAL
CONNECT BY ROWNUM <= LENGTH('BSP/B2B/SFS/') -LENGTH(REPLACE('BSP/B2B/SFS/', '/', '')) + 1)
where item not in (
SELECT nvl(REGEXP_SUBSTR('BPET,BSP,B2B', '[^,]+', 1, rownum),'NULL') FROM DUAL
CONNECT BY ROWNUM <= LENGTH('BPET,BSP,B2B') -LENGTH(REPLACE('BPET,BSP,B2B', ',', '')) + 1
)