oracle将一列字符串转换为多行显示

将一列字符串显示为转换为多行显示?
现在有一个字符串

'00010430, 00228290, 07046884, 07383953'

sql 查询结果:

00010430
00228290
07046884
07383953

 实现sql

with a as (select '00010430, 00228290, 07046884, 07383953' id from dual)
select regexp_substr(replace(id,', ',','),'[^,]+',1,rownum) id from a
connect by rownum<=length(regexp_replace(replace(id,', ',','),'[^,]+'))+1

 

猜你喜欢

转载自aniyo.iteye.com/blog/2109251