原文链接:https://www.cnblogs.com/yanqin/p/7145093.html

原select的结果是:1|3|4|6|9 把结果转换成

1
3
4
6
9

转换的sql,此处用的“|”分割可以替换成实际的字符 :

with CTE1 as (select zyxdm from table where bindid=2265254)
SELECT REGEXP_SUBSTR((select * from CTE1), '[^|]+', 1, ROWNUM) id
FROM DUAL CONNECT BY ROWNUM <= LENGTH((select * from CTE1))
- LENGTH(REPLACE((select * from CTE1), '|', '')) + 1