需求:实现把out分割成O1、O2;A分割成A1,A2,即:
1、sql如下:
SELECT distinct REGEXP_SUBSTR(q.bin, '[^,]+', 1, LEVEL, 'i') AS STR
FROM (
select distinct
case bin
when 'out' then 'O1,O2'
when 'A' then 'A1,A2'
end bin
from wms_blc_current_detail
) q where bin is not null
CONNECT BY LEVEL <= LENGTH(q.bin) - LENGTH(REGEXP_REPLACE(q.bin, ',', '')) + 1;